Class SemanticTags

java.lang.Object
org.openhab.core.semantics.SemanticTags

@NonNullByDefault public class SemanticTags extends Object
This is a class that gives static access to the semantic tag library. For everything that is not static, the SemanticsService should be used instead.
Author:
Kai Kreuzer - Initial contribution, Jimmy Tanagra - Add the ability to add new tags at runtime, Laurent Garnier - Several methods moved into class SemanticsService or SemanticTagRegistry
  • Constructor Details

    • SemanticTags

      public SemanticTags()
  • Method Details

    • getById

      public static @Nullable Class<? extends Tag> getById(String tagId)
      Retrieves the class for a given id.
      Parameters:
      tagId - the id of the tag. The id can be fully qualified (e.g. "Location_Room_Bedroom") or a segment, if this uniquely identifies the tag (e.g. "Bedroom").
      Returns:
      the class for the id or null, if non exists.
    • getSemanticType

      public static @Nullable Class<? extends Tag> getSemanticType(Item item)
      Determines the semantic type of an Item i.e. a sub-type of Location, Equipment or Point.
      Parameters:
      item - the Item to get the semantic type for
      Returns:
      a sub-type of Location, Equipment or Point
    • getProperty

      public static @Nullable Class<? extends Property> getProperty(Item item)
      Determines the Property type that a Point relates to.
      Parameters:
      item - the Item to get the property for
      Returns:
      a sub-type of Property if the Item represents a Point, otherwise null
    • getPoint

      public static @Nullable Class<? extends Point> getPoint(Item item)
      Determines the semantic Point type of an Item.
      Parameters:
      item - the Item to get the Point for
      Returns:
      a sub-type of a Pointif the Item represents a Point, otherwise null
    • getEquipment

      public static @Nullable Class<? extends Equipment> getEquipment(Item item)
      Determines the semantic Equipment type of an Item.
      Parameters:
      item - the Item to get the Equipment for
      Returns:
      a sub-type of Equipment if the Item represents an Equipment, otherwise null
    • getLocation

      public static @Nullable Class<? extends Location> getLocation(Item item)
      Determines the semantic Location type of an Item.
      Parameters:
      item - the item to get the location for
      Returns:
      a sub-type of Location if the item represents a location, otherwise null
    • addTagSet

      public static void addTagSet(String id, Class<? extends Tag> tagSet)
    • removeTagSet

      public static void removeTagSet(String id, Class<? extends Tag> tagSet)