Class Property


  • public final class Property
    extends java.lang.Object
    Represents a value of the property datatype, as listed in vocabulary of properties.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Property​(java.lang.String name, java.lang.String base, java.lang.String prefix, java.lang.Enum<?> enumee)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      static <E extends java.lang.Enum<E>>
      java.util.Set<E>
      filter​(java.util.Set<Property> properties, java.lang.Class<E> clazz)
      Filters the given set of Property values and keeps the values backed by an Enum constant of the given type.
      java.lang.String getFullName()
      Returns the full URI value of this property.
      java.lang.String getName()
      Returns the short name (afa "reference") of this property.
      java.lang.String getPrefixedName()
      Returns the prefixed name (aka CURIE) of this property.
      java.lang.String getVocabURI()
      Returns the vocab URI of this property.
      int hashCode()  
      boolean isAllowed​(ValidationContext context)
      Returns whether this property is allowed in the given validation context.
      boolean isDeprecated()
      Returns whether this property is deprecated.
      static Property newFrom​(java.lang.String name, java.lang.String base, java.lang.String prefix)
      Creates a new instance from a short name, a prefix, and a stem URI.
      static Property newFrom​(java.lang.String name, java.lang.String base, java.lang.String prefix, java.lang.Enum<?> enumee)
      Creates a new instance from a short name, a prefix, and a stem URI, and an optional Enum item used to represent this property in known vocabularies.
      java.lang.Enum<?> toEnum()
      Returns the Enum item that is used to represent this property in enum-based vocabularies.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • base

        private final java.lang.String base
      • name

        private final java.lang.String name
      • prefixedName

        private final java.lang.String prefixedName
      • fullName

        private final java.lang.String fullName
      • enumee

        private final java.lang.Enum<?> enumee
    • Constructor Detail

      • Property

        private Property​(java.lang.String name,
                         java.lang.String base,
                         java.lang.String prefix,
                         java.lang.Enum<?> enumee)
    • Method Detail

      • newFrom

        public static Property newFrom​(java.lang.String name,
                                       java.lang.String base,
                                       java.lang.String prefix)
        Creates a new instance from a short name, a prefix, and a stem URI.
        Parameters:
        name - the short name of the property (aka "reference").
        base - the stem URI used to compute the full URI value.
        prefix - the prefix used in the CURIE form.
        Returns:
      • newFrom

        public static Property newFrom​(java.lang.String name,
                                       java.lang.String base,
                                       java.lang.String prefix,
                                       java.lang.Enum<?> enumee)
        Creates a new instance from a short name, a prefix, and a stem URI, and an optional Enum item used to represent this property in known vocabularies.
        Parameters:
        name - the short name of the property (aka "reference").
        base - the stem URI used to compute the full URI value.
        prefix - the prefix used in the CURIE form.
        Returns:
      • filter

        public static <E extends java.lang.Enum<E>> java.util.Set<E> filter​(java.util.Set<Property> properties,
                                                                            java.lang.Class<E> clazz)
        Filters the given set of Property values and keeps the values backed by an Enum constant of the given type.
        Parameters:
        properties - the properties to filter
        clazz - the class of a vocabulary-backing enum
        Returns:
        An immutable EnumSet representing the filtered properties
      • getName

        public java.lang.String getName()
        Returns the short name (afa "reference") of this property.
        Returns:
        the short name (afa "reference") of this property.
      • getFullName

        public java.lang.String getFullName()
        Returns the full URI value of this property.
        Returns:
        the full URI value of this property.
      • getPrefixedName

        public java.lang.String getPrefixedName()
        Returns the prefixed name (aka CURIE) of this property.
        Returns:
        the prefixed name (aka CURIE) of this property.
      • getVocabURI

        public java.lang.String getVocabURI()
        Returns the vocab URI of this property.
        Returns:
        the URI of the vocab where this property is defined
      • isAllowed

        public boolean isAllowed​(ValidationContext context)
        Returns whether this property is allowed in the given validation context. Disallowed properties are reported as ERRORs.
        Parameters:
        context - the validation context (locale, path, etc).
        Returns:
        true iff the property is allowed in the given context
      • isDeprecated

        public boolean isDeprecated()
        Returns whether this property is deprecated. Deprecated properties are reported as WARNINGs.
        Returns:
        true iff the property is deprecated
      • toEnum

        public java.lang.Enum<?> toEnum()
        Returns the Enum item that is used to represent this property in enum-based vocabularies.
        Returns:
        the Enum item that is used to represent this property.
        Throws:
        java.lang.UnsupportedOperationException - if this property doesn't represent a property from an enum-based vocabulary.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object