If you think the Android project Boxee-Thumb-Remote listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/* The following code was written by Menny Even Danan
* and is released under the APACHE 2.0 license
*//www.java2s.com
* http://www.apache.org/licenses/LICENSE-2.0
*/package net.evendanan.android.thumbremote;
import java.net.InetAddress;
/**
* Holds information about a media server which announced itself in response to
* a discovery request.
*/publicfinalclass ServerAddress {
privatefinal String mType;
privatefinal String mVersion;
privatefinal String mName;
privatefinalboolean mAuthRequired;
privatefinalint mPort;
privatefinal InetAddress mAddr;
public ServerAddress(String type, String version, String name, boolean authRequired, InetAddress address, int port) {
mAddr = address;
mVersion = version;
mPort = port;
mType = type;
mName = name;
mAuthRequired = authRequired;
}
publicboolean valid() {
return mPort > 0 && mAddr != null;
}
public String type() {
return mType;
}
public String version(){
return mVersion;
}
public String name() {
return mName;
}
publicboolean authRequired() {
return mAuthRequired;
}
publicint port() {
return mPort;
}
public InetAddress address() {
return mAddr;
}
public String toString() {
return String.format("%s at %s:%d %s", mName, mAddr.getHostAddress(),
mPort, valid() ? "" : "(broken?)");
}
}