Class AbstractUID

  • Direct Known Subclasses:
    MetadataKey, UID

    public abstract class AbstractUID
    extends Object
    A non specific base class for unique identifiers within the SmartHome framework.
    Markus Rathgeb - Initial contribution
    • Constructor Detail

      • AbstractUID

        public AbstractUID()
        Constructor must be public, otherwise it can not be called by subclasses from another package.
      • AbstractUID

        public AbstractUID​(String uid)
        Parses a UID for a given string. The UID must be in the format 'bindingId:segment:segment:...'.
        uid - uid in form a string (must not be null)
      • AbstractUID

        public AbstractUID​(String... segments)
        Creates a AbstractUID for a list of segments.
        segments - the id segments
      • AbstractUID

        public AbstractUID​(List<String> segments)
        Creates a UID for list of segments.
        segments - segments (must not be null)
    • Method Detail

      • getMinimalNumberOfSegments

        protected abstract int getMinimalNumberOfSegments()
        Specifies how many segments the UID has to have at least.
      • getAllSegments

        protected List<String> getAllSegments()
      • getSegment

        protected String getSegment​(int segment)
      • validateSegment

        protected void validateSegment​(String segment,
                                       int index,
                                       int length)
      • getAsString

        public String getAsString()
      • hashCode

        public int hashCode()
        hashCode in class Object
      • equals

        public boolean equals​(@Nullable Object obj)
        equals in class Object