public UnsignedVariableInteger increment(boolean rolloverToOne) { if (value + 1 > getBits().getMaxValue()) { value = rolloverToOne ? 1 : 0; } else { value++; } return this; }
@Override public String toString() { return getUdn().toString() + "::" + getServiceType().toString(); }
public PortMapping(int port, String internalClient, Protocol protocol) { this( true, new UnsignedIntegerFourBytes(0), null, new UnsignedIntegerTwoBytes(port), new UnsignedIntegerTwoBytes(port), internalClient, protocol, null ); }
@Override public String toString() { return getUdn().toString() + "::" + getDeviceType().toString(); }
public static NamedServiceType valueOf(String s) throws InvalidValueException { String[] strings = s.split("::"); if (strings.length != 2) { throw new InvalidValueException("Can't parse UDN::ServiceType from: " + s); } UDN udn; try { udn = UDN.valueOf(strings[0]); } catch (Exception ex) { throw new InvalidValueException("Can't parse UDN: " + strings[0]); } ServiceType serviceType = ServiceType.valueOf(strings[1]); return new NamedServiceType(udn, serviceType); }
public String getDisplayString() { if (this instanceof CustomDatatype) { return ((CustomDatatype)this).getName(); } else if (getBuiltin() != null) { return getBuiltin().getDescriptorName(); } else { return getValueType().getSimpleName(); } }
public PositionInfo(long track, String trackMetaData, String trackURI) { this.track = new UnsignedIntegerFourBytes(track); this.trackMetaData = trackMetaData; this.trackURI = trackURI; }
public String getTypeString() { if (version == null) { return "urn:" + getNamespace() + ":" + getType(); } else { return "urn:" + getNamespace() + ":service:" + getType() + ":" + getVersion(); } }
/** * * @return String format of Bytes Range for response message header */ public String getString() { return getString(false,null); }
public NormalPlayTime(long milliseconds) { if (milliseconds < 0) { throw new InvalidValueException("Invalid parameter milliseconds: " + milliseconds); } this.milliseconds = milliseconds; }
<VT> Builtin(String descriptorName, AbstractDatatype<VT> datatype) { datatype.setBuiltin(this); // Protected, we actually want this to be immutable this.descriptorName = descriptorName; this.datatype = datatype; }
public PortMapping(int port, String internalClient, Protocol protocol, String description) { this( true, new UnsignedIntegerFourBytes(0), null, new UnsignedIntegerTwoBytes(port), new UnsignedIntegerTwoBytes(port), internalClient, protocol, description ); }
public PortMapping(String remoteHost, UnsignedIntegerTwoBytes externalPort, Protocol protocol) { this( true, new UnsignedIntegerFourBytes(0), remoteHost, externalPort, null, null, protocol, null ); }