adaptation of old eclipse code to Intellij
This commit is contained in:
@@ -19,81 +19,30 @@
|
||||
|
||||
package peers.sdp;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.net.Inet4Address;
|
||||
import java.net.Inet6Address;
|
||||
import java.net.InetAddress;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
|
||||
@Getter @Setter
|
||||
public class SessionDescription {
|
||||
|
||||
private long id;
|
||||
private long version;
|
||||
private String name;
|
||||
private String username;
|
||||
private InetAddress ipAddress;
|
||||
|
||||
private InetAddress ipAddress;
|
||||
private List<MediaDescription> mediaDescriptions;
|
||||
private Hashtable<String, String> attributes;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public InetAddress getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setIpAddress(InetAddress ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public List<MediaDescription> getMediaDescriptions() {
|
||||
return mediaDescriptions;
|
||||
}
|
||||
|
||||
public void setMediaDescriptions(List<MediaDescription> mediaDescriptions) {
|
||||
this.mediaDescriptions = mediaDescriptions;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public long getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(long version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Hashtable<String, String> getAttributes() {
|
||||
return attributes;
|
||||
}
|
||||
|
||||
public void setAttributes(Hashtable<String, String> attributes) {
|
||||
this.attributes = attributes;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append("v=0\r\n");
|
||||
buf.append("o=").append(username).append(" ").append(id);
|
||||
buf.append(" ").append(version);
|
||||
@@ -115,7 +64,7 @@ public class SessionDescription {
|
||||
for (String attributeName: attributes.keySet()) {
|
||||
String attributeValue = attributes.get(attributeName);
|
||||
buf.append("a=").append(attributeName);
|
||||
if (attributeValue != null && !"".equals(attributeValue.trim())) {
|
||||
if (attributeValue != null && !attributeValue.trim().isEmpty()) {
|
||||
buf.append(":");
|
||||
buf.append(attributeValue);
|
||||
buf.append("\r\n");
|
||||
|
||||
Reference in New Issue
Block a user