Class Facet

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

@Entity public class Facet extends BaseNamespaceEntity<Facet> implements BaseCmfEntity<org.mitre.niem.cmf.Facet>, Comparable<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.
  • 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
    • getIdLabel

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

      public String getIdLocalLabel()
      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:
      getIdLocalLabel 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 org.mitre.niem.cmf.Facet addToCmfModel(org.mitre.niem.cmf.Model cmfModel, boolean addDependencies, AddModelReason addModelReason, Test test) 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>
      Parameters:
      cmfModel - The CMF model.
      addDependencies - True to also add dependencies if not already in the CMF model (namespace, type, group); false (default) to just add this property.
      addModelReason - Indicates the reason why a component is being added to the model, either directly due to a task like migration or transformation, or indirectly as a required dependency.
      test - If present, log info to given test object.
      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.
    • compareTo

      public int compareTo(Facet other)
      Custom sort function for facets, sorting by id label.
      Specified by:
      compareTo in interface Comparable<Facet>