Class VocabularyTerm

  • All Implemented Interfaces:
    Serializable

    @Immutable
    @MustImplementEqualsAndHashcode
    public final class VocabularyTerm
    extends Object
    implements Serializable
    This is a helper class to have an easy way to provide a vocabulary term.
    Author:
    Philip Helger
    See Also:
    Serialized Form
    • Method Detail

      • getVocabulary

        @Nonnull
        @Nonempty
        public String getVocabulary()
        Returns:
        The vocabulary as provided in the constructor. Neither null nor empty.
      • hasVocabulary

        public boolean hasVocabulary​(@Nullable
                                     String sVocabulary)
        Check if this term has the provided vocabulary or not.
        Parameters:
        sVocabulary - The vocabulary to compare to. May be null.
        Returns:
        true if the vocabularies are identical.
      • getTerm

        @Nonnull
        @Nonempty
        public String getTerm()
        Returns:
        The term as provided in the constructor. Neither null nor empty.
      • hasTerm

        public boolean hasTerm​(@Nullable
                               String sTerm)
        Check if this vocabulary term has the provided term or not.
        Parameters:
        sTerm - The term to compare to. May be null.
        Returns:
        true if the values are identical.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object