Package gov.niem.tools.api.db.facet
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumKinds of facet categories, such as enumeration, pattern, and length. -
Constructor Summary
ConstructorsConstructorDescriptionFacet(Type type, Facet.Category category, String value, String definition) Creates a new facet with the given fields on the given type. -
Method Summary
Modifier and TypeMethodDescriptionorg.mitre.niem.cmf.FacetaddToCmfModel(org.mitre.niem.cmf.Model cmfModel, boolean addDependencies, AddModelReason addModelReason, Test test) Adds this facet to the given CMF model.intCustom sort function for facets, sorting by id label.A kind of NIEM entity, such as a Namespace or a Property.getCmfFacetKind(Facet.Category category) CMF Facet.facetKind values must be upper camel case.A human-readable and url-friendly unique identifier for an entity.An identifier, unique within its immediate scope.Gets the Namespace that contains the type of this facet.An immediate entity or scope to which this entity belongs.getRoute()An endpoint to get information about an entity.getTitle()A descriptive label or title used to identify an entity.getType()Gets the Type that contains this facet.org.mitre.niem.cmf.FacettoCmf()Converts this facet to a CMF facet object.Methods inherited from class gov.niem.tools.api.db.base.BaseNamespaceEntity
getNamespaceId, getNamespaceSummary, getVersionMethods inherited from class gov.niem.tools.api.db.base.BaseVersionEntity
getCurrent, getModel, getNiemVersion, getNiemVersionNumber, getOriginal, getVersionId, getVersionNumber, getVersionSummary, isCurrent, isOriginalMethods inherited from class gov.niem.tools.api.db.base.BaseVersionedEntity
getNext, getPrevMethods inherited from class gov.niem.tools.api.db.base.BaseModelEntity
getModelKey, getModelSummary, getStewardMethods inherited from class gov.niem.tools.api.db.base.BaseStewardEntity
getStewardKey, getStewardSummary
-
Constructor Details
-
Facet
Creates a new facet with the given fields on the given type.
-
-
Method Details
-
getNamespace
Gets the Namespace that contains the type of this facet.- Specified by:
getNamespacein classBaseNamespaceEntity<Facet>
-
getType
Gets the Type that contains this facet. -
getParentEntity
Description copied from class:BaseEntityAn 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:
getParentEntityin classBaseEntity
-
getRoute
Description copied from class:BaseEntityAn endpoint to get information about an entity.- Specified by:
getRoutein classBaseEntity
-
getClassName
Description copied from class:BaseEntityA kind of NIEM entity, such as a Namespace or a Property.- Overrides:
getClassNamein classBaseEntity
-
getIdLabel
Description copied from class:BaseEntityA human-readable and url-friendly unique identifier for an entity.- Specified by:
getIdLabelin classBaseEntity
-
getIdLocalLabel
Description copied from class:BaseEntityAn 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:
getIdLocalLabelin classBaseEntity
-
getTitle
Description copied from class:BaseEntityA descriptive label or title used to identify an entity.- Specified by:
getTitlein classBaseEntity
-
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:
addToCmfModelin interfaceBaseCmfEntity<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.CMFExceptionConverts this facet to a CMF facet object.- Specified by:
toCmfin interfaceBaseCmfEntity<org.mitre.niem.cmf.Facet>- Throws:
org.mitre.niem.cmf.CMFException
-
getCmfFacetKind
CMF Facet.facetKind values must be upper camel case. -
compareTo
Custom sort function for facets, sorting by id label.- Specified by:
compareToin interfaceComparable<Facet>
-