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
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor must be protected, otherwise it can not be called by subclasses from another package.protected
AbstractUID
(String uid) Parses a UID for a given string.protected
AbstractUID
(String... segments) Creates an AbstractUID for a list of segments.protected
AbstractUID
(List<String> segments) Creates a UID for list of segments. -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected abstract int
Specifies how many segments the UID has to have at least.protected String
getSegment
(int segment) int
hashCode()
static boolean
toString()
protected void
validateSegment
(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
-