Interface MetaTagCollection

    • Method Detail

      • getMetaTags

        <T> Collection<MetaTag<T>> getMetaTags()
        Type Parameters:
        T - returns a collection of all the meta tags
        Returns:
        the collection of all current meta tags
      • getMetaTagValue

        default <T> T getMetaTagValue​(String key,
                                      Class<T> clazz)
        Returns the value for a meta tag with a given key
        Type Parameters:
        T - the type of the meta tag value
        Parameters:
        key - the key of the meta tag
        clazz - the class of the meta tag value
        Returns:
        the value of the meta tag, if there are multiple elements with the same key and class type, the first one which is matching will be returned
        Throws:
        IllegalStateException - if no meta tag with the given key exists, or if the meta tag value does not match the clazz type.
      • tryGetMetaTagValue

        default <T> Optional<T> tryGetMetaTagValue​(String key,
                                                   Class<T> clazz)
        Tries to get a value for a given meta tag with a given key
        Type Parameters:
        T - the type of the meta tag value
        Parameters:
        key - the key of the meta tag
        clazz - the class of the meta tag value
        Returns:
        the value of the meta tag, if there are multiple elements with the same key class type, the first one which is matching will be returned
      • getMetaTagValue

        default <T> T getMetaTagValue​(String key)
        Returns the first value for a meta tag with a given key or throws an exception if not present
        Type Parameters:
        T - the type of the meta tag
        Parameters:
        key - the key
        Returns:
        the value if present
        See Also:
        getMetaTagValue(String, Class)
      • tryGetMetaTagValue

        default <T> Optional<T> tryGetMetaTagValue​(String key)
        Try to return the first value for a meta tag with a given key
        Type Parameters:
        T - the type of the meta tag
        Parameters:
        key - the key
        Returns:
        the value if present
        See Also:
        tryGetMetaTagValue(String, Class)
      • addMetaTag

        <T> boolean addMetaTag​(MetaTag<T> metaTag)
        Adds a meta tag to the current vertex
        Type Parameters:
        T - the type of the meta tag to add
        Parameters:
        metaTag - the meta tag
        Returns:
        a flag which indicates if the element was added
      • removeMetaTag

        <T> boolean removeMetaTag​(MetaTag<T> metaTag)
        Removes a meta tag from the current vertex
        Type Parameters:
        T - the type of the meta tag to remove
        Parameters:
        metaTag - the meta tag
        Returns:
        a flag which indicates if the element was removed
      • removeMetaTag

        default void removeMetaTag​(String key,
                                   Class<?>... clazz)

        Removes all meta that, where the key of the meta tag equals the key parameter. Optionally it also checks if the value type is one of the given classes. If classes is null or empty it will only check for the key. After calling this method the meta tag with the associated key will be removed. In case the key does not exist, no error will occur.

        Parameters:
        key - the key of the meta tag to be removed
        clazz - optional: a list of possible types where the meta tag must be one of them.