Package org.openhab.core.common
Class AbstractUID
java.lang.Object
org.openhab.core.common.AbstractUID
- Direct Known Subclasses:
MetadataKey,UID
A non specific base class for unique identifiers.
- Author:
- Markus Rathgeb - Initial contribution
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor must be protected, otherwise it can not be called by subclasses from another package.protectedAbstractUID(String uid) Parses a UID for a given string.protectedAbstractUID(String... segments) Creates an AbstractUID for a list of segments.protectedAbstractUID(List<String> segments) Creates a UID for list of segments. -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected abstract intSpecifies how many segments the UID has to have at least.protected StringgetSegment(int segment) inthashCode()static booleantoString()protected voidvalidateSegment(String segment, int index, int length)
-
Field Details
-
SEPARATOR
- See Also:
-
-
Constructor Details
-
AbstractUID
protected AbstractUID()Constructor must be protected, otherwise it can not be called by subclasses from another package. -
AbstractUID
Parses a UID for a given string. The UID must be in the format 'bindingId:segment:segment:...'.- Parameters:
uid- uid in form a string
-
AbstractUID
Creates an AbstractUID for a list of segments.- Parameters:
segments- the id segments
-
AbstractUID
Creates a UID for list of segments.- Parameters:
segments- segments
-
-
Method Details
-
getMinimalNumberOfSegments
protected abstract int getMinimalNumberOfSegments()Specifies how many segments the UID has to have at least.- Returns:
- the number of segments
-
getAllSegments
-
getSegment
-
isValid
-
validateSegment
-
toString
-
getAsString
-
hashCode
public int hashCode() -
equals
-