Class AbstractLink

java.lang.Object
org.openhab.core.thing.link.AbstractLink
All Implemented Interfaces:
Identifiable<String>
Direct Known Subclasses:
ItemChannelLink

@NonNullByDefault public abstract class AbstractLink extends Object implements Identifiable<String>
AbstractLink is the abstract base class of all links.
Author:
Dennis Nobel - Initial contribution
  • Constructor Details

    • AbstractLink

      protected AbstractLink(String itemName)
      Constructor.
      Parameters:
      itemName - the item name for the link
      Throws:
      IllegalArgumentException - if the item name is invalid
    • AbstractLink

      protected AbstractLink()
  • Method Details

    • getIDFor

      public static String getIDFor(String itemName, UID uid)
      Returns the link ID for a given item name and UID
      Parameters:
      itemName - item name
      uid - UID
      Returns:
      the item channel link ID
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • getUID

      public String getUID()
      Returns the ID for the link.
      Specified by:
      getUID in interface Identifiable<String>
      Returns:
      id (can not be null)
    • getItemName

      public String getItemName()
      Returns the item that is linked to the object.
      Returns:
      item name (can not be null)
    • getLinkedUID

      public abstract UID getLinkedUID()
      Returns the UID of the object, which is linked to the item.
      Returns:
      UID (can not be null)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object