liusuyi
2026-05-06 99ab0d46d30b095d0e1c9d31349f42e0cefc9881
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package com.ard.zlm.api.domain;
 
import java.io.Serializable;
 
 
/**
 * 流地址信息
 */
public class StreamURL implements Serializable,Cloneable {
 
    /**
     * 协议
     */
    private String protocol;
 
    /**
     * 主机地址
     */
    private String host;
 
    /**
     * 端口
     */
    private int port = -1;
 
    /**
     * 定位位置
     */
    private String file;
 
    /**
     * 拼接后的地址
     */
    private String url;
 
    public StreamURL() {
    }
 
    public StreamURL(String protocol, String host, int port, String file) {
        this.protocol = protocol;
        this.host = host;
        this.port = port;
        this.file = file;
    }
 
    public String getProtocol() {
        return protocol;
    }
 
    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }
 
    public String getHost() {
        return host;
    }
 
    public void setHost(String host) {
        this.host = host;
    }
 
    public int getPort() {
        return port;
    }
 
    public void setPort(int port) {
        this.port = port;
    }
 
    public String getFile() {
        return file;
    }
 
    public void setFile(String file) {
        this.file = file;
    }
 
    public String getUrl() {
        return this.toString();
    }
 
    @Override
    public String toString() {
        if (protocol != null && host != null && port != -1 ) {
            return String.format("%s://%s:%s/%s", protocol, host, port, file);
        }else {
            return null;
        }
    }
    @Override
    public StreamURL clone() throws CloneNotSupportedException {
        return (StreamURL) super.clone();
    }
}