Class 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
    • Constructor Detail

      • SemanticTags

        public SemanticTags()
    • Method Detail

      • 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.
      • getByLabel

        public static @Nullable Class<? extends Tag> getByLabel​(String tagLabel,
                                                                Locale locale)
      • getByLabelOrSynonym

        public static List<Class<? extends Tag>> getByLabelOrSynonym​(String tagLabelOrSynonym,
                                                                     Locale locale)
      • 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 an 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