Package org.jupnp.model
Klasse ModelUtil
java.lang.Object
org.jupnp.model.ModelUtil
Shared trivial procedures.
- Autor:
- Christian Bauer
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final booleanTrue if this class is executing on an Android emulator runtime.static final booleanTrue if this class is executing on an Android runtime -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic Stringstatic String[]Converts the comma-separated elements of a string into an array of strings, unescaping backslashed commas.static String[]fromCommaSeparatedList(String s, boolean unescapeCommas) Converts the comma-separated elements of a string into an array of strings, optionally unescaping backslashed commas.static longstatic byte[]static InetAddressgetInetAddressByName(String name) Wraps the checked exception in a runtime exception.static StringgetLocalHostName(boolean includeDomain) DNS reverse name lookup.static booleanisStringConvertibleType(Set<Class> stringConvertibleTypes, Class clazz) static booleanisValidUDAName(String name) static StringConverts the given instances into comma-separated elements of a string, escaping commas with backslashes.static StringtoCommaSeparatedList(Object[] o, boolean escapeCommas, boolean escapeDoubleQuotes) Converts the given instances into comma-separated elements of a string, optionally escapes commas and double quotes with backslahses.static StringtoTimeString(long seconds)
-
Felddetails
-
ANDROID_RUNTIME
public static final boolean ANDROID_RUNTIMETrue if this class is executing on an Android runtime -
ANDROID_EMULATOR
public static final boolean ANDROID_EMULATORTrue if this class is executing on an Android emulator runtime.
-
-
Konstruktordetails
-
ModelUtil
public ModelUtil()
-
-
Methodendetails
-
isStringConvertibleType
- Parameter:
stringConvertibleTypes- A collection of interfaces.clazz- An interface to test.- Gibt zurück:
trueif the given interface is an Enum, or if the collection contains a super-interface.
-
isValidUDAName
- Parameter:
name- A UPnP device architecture "name" string.- Gibt zurück:
trueif the name is not empty, doesn't start with "xml", and matchesConstants.REGEX_UDA_NAME.
-
getInetAddressByName
Wraps the checked exception in a runtime exception. -
toCommaSeparatedList
Converts the given instances into comma-separated elements of a string, escaping commas with backslashes. -
toCommaSeparatedList
public static String toCommaSeparatedList(Object[] o, boolean escapeCommas, boolean escapeDoubleQuotes) Converts the given instances into comma-separated elements of a string, optionally escapes commas and double quotes with backslahses. -
fromCommaSeparatedList
Converts the comma-separated elements of a string into an array of strings, unescaping backslashed commas. -
fromCommaSeparatedList
Converts the comma-separated elements of a string into an array of strings, optionally unescaping backslashed commas. -
toTimeString
- Parameter:
seconds- The number of seconds to convert.- Gibt zurück:
- A string representing hours, minutes, seconds, e.g.
11:23:44
-
fromTimeString
- Parameter:
s- A string representing hours, minutes, seconds, e.g.11:23:44- Gibt zurück:
- The converted number of seconds.
-
commaToNewline
- Parameter:
s- A string with commas.- Gibt zurück:
- The same string, a newline appended after every comma.
-
getLocalHostName
DNS reverse name lookup.- Parameter:
includeDomain-trueif the whole FQDN should be returned, instead of just the first (host) part.- Gibt zurück:
- The resolved host (and domain-) name, or "UNKNOWN HOST" if resolution failed.
-
getFirstNetworkInterfaceHardwareAddress
public static byte[] getFirstNetworkInterfaceHardwareAddress()- Gibt zurück:
- The MAC hardware address of the first network interface of this host.
-