Class Facet

All Implemented Interfaces:
BaseCmfEntity<org.mitre.niem.cmf.Facet>, Serializable

@Entity public class Facet extends BaseNamespaceEntity<Facet> implements BaseCmfEntity<org.mitre.niem.cmf.Facet>
A constraint on a datatype, such as an enumeration or a pattern.
See Also:
  • Constructor Details

    • Facet

      public Facet(Type type, Facet.Category category, String value, String definition)
      Creates a new facet with the given fields on the given type.
    • Facet

      public Facet()
    • Facet

      public Facet(Type type, String prefix, String qname, Long versionId, Facet.Category category, String value, String definition)
      Creates a new Facet instance.
      Parameters:
      type - Type that contains the facet.
      prefix -
      qname -
      versionId -
      category - A kind of facet, e.g., "enumeration"
      value -
      definition -
  • Method Details

    • getNamespace

      public Namespace getNamespace()
      Gets the Namespace that contains the type of this facet.
      Specified by:
      getNamespace in class BaseNamespaceEntity<Facet>
    • getType

      public Type getType()
      Gets the Type that contains this facet.
    • getParentEntity

      public Type getParentEntity()
      Description copied from class: BaseEntity
      An immediate entity or scope to which this entity belongs. Examples include a steward (parent) for a model or a namespace (parent) for a property or type.
      Specified by:
      getParentEntity in class BaseEntity
    • getRoute

      public String getRoute()
      Description copied from class: BaseEntity
      An endpoint to get information about an entity.
      Specified by:
      getRoute in class BaseEntity
    • getClassName

      public String getClassName()
      Description copied from class: BaseEntity
      A kind of NIEM entity, such as a Namespace or a Property.
      Overrides:
      getClassName in class BaseEntity
    • getFullIdentifier

      public String getFullIdentifier()
      Description copied from class: BaseEntity
      A human-readable and url-friendly unique identifier for an entity.
      Specified by:
      getFullIdentifier in class BaseEntity
    • getLocalIdentifier

      public String getLocalIdentifier()
      Description copied from class: BaseEntity
      An identifier, unique within its immediate scope. Examples include a prefix (uniquely identifying a namespace) or a qualified name (uniquely identifying a property or a type) within a version of a model.
      Specified by:
      getLocalIdentifier in class BaseEntity
    • getTitle

      public String getTitle()
      Description copied from class: BaseEntity
      A descriptive label or title used to identify an entity.
      Specified by:
      getTitle in class BaseEntity
    • addToCmfModel

      public void addToCmfModel(org.mitre.niem.cmf.Model cmfModel) throws org.mitre.niem.cmf.CMFException
      Adds this facet to the given CMF model.
      Specified by:
      addToCmfModel in interface BaseCmfEntity<org.mitre.niem.cmf.Facet>
      Throws:
      org.mitre.niem.cmf.CMFException
    • toCmf

      public org.mitre.niem.cmf.Facet toCmf() throws org.mitre.niem.cmf.CMFException
      Converts this facet to a CMF facet object.
      Specified by:
      toCmf in interface BaseCmfEntity<org.mitre.niem.cmf.Facet>
      Throws:
      org.mitre.niem.cmf.CMFException
    • getCmfFacetKind

      public String getCmfFacetKind(Facet.Category category)
      CMF Facet.facetKind values must be upper camel case.
    • builder

      public static Facet.FacetBuilder builder()
    • getPrefix

      public String getPrefix()
    • getQname

      public String getQname()
    • getVersionId

      public Long getVersionId()
      Description copied from class: BaseVersionEntity
      Gets the version database id.
      Overrides:
      getVersionId in class BaseVersionEntity<Facet>
    • getCategory

      public Facet.Category getCategory()
      A kind of facet, e.g., "enumeration"
    • getValue

      public String getValue()
    • getDefinition

      public String getDefinition()
    • setType

      public void setType(Type type)
      Type that contains the facet.
    • setPrefix

      public void setPrefix(String prefix)
    • setQname

      public void setQname(String qname)
    • setVersionId

      public void setVersionId(Long versionId)
    • setCategory

      public void setCategory(Facet.Category category)
      A kind of facet, e.g., "enumeration"
    • setValue

      public void setValue(String value)
    • setDefinition

      public void setDefinition(String definition)
    • toString

      public String toString()
      Overrides:
      toString in class BaseNamespaceEntity<Facet>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class BaseNamespaceEntity<Facet>
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class BaseNamespaceEntity<Facet>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BaseNamespaceEntity<Facet>