Package org.faktorips.runtime.validation
Enum Relevance
- All Implemented Interfaces:
Serializable,Comparable<Relevance>,java.lang.constant.Constable
Defines the relevance of a
PolicyAttribute, derived from its
value set:
- An attribute with an empty (or
null) value set is consideredIRRELEVANT- no value should be set - An attribute with value set
containingnullis consideredOPTIONAL- a value can be set but is not required - An attribute with a non-empty value set not
containingnullis consideredMANDATORY- a value must be set
IRRELEVANT (OPTIONAL or MANDATORY) is
considered relevant - its value should for example be checked against the value set.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn attribute with an empty (ornull) value set - no value should be set.An attribute with a non-empty value set notcontainingnull- a value must be set.An attribute with value setcontainingnull- a value can be set but is not required. -
Method Summary
Modifier and TypeMethodDescription<T> org.faktorips.valueset.ValueSet<T>asValueSetFor(IModelObject modelObject, String property) Returns aValueSetfor the given model object's attribute identified by the given property name that matches thisRelevance.<T> org.faktorips.valueset.ValueSet<T>asValueSetFor(IModelObject modelObject, String property, Collection<T> values) Returns aValueSetfor the given model object's attribute that matches thisRelevance.<T> org.faktorips.valueset.ValueSet<T>asValueSetFor(IModelObject modelObject, String property, org.faktorips.valueset.ValueSet<T> values) Returns aValueSetfor the given model object's attribute identified by the given property name that matches thisRelevance.<T> org.faktorips.valueset.ValueSet<T>asValueSetFor(IModelObject modelObject, PolicyAttribute policyAttribute) Returns aValueSetfor the given model object's attribute that matches thisRelevance.<T> org.faktorips.valueset.ValueSet<T>asValueSetFor(IModelObject modelObject, PolicyAttribute policyAttribute, Collection<T> values) Returns aValueSetfor the given model object's attribute that matches thisRelevance.abstract <T> org.faktorips.valueset.ValueSet<T>asValueSetFor(IModelObject modelObject, PolicyAttribute policyAttribute, org.faktorips.valueset.ValueSet<T> values) Returns aValueSetfor the given model object's attribute that matches thisRelevance.static booleanisIrrelevant(IModelObject modelObject, String property) Returns whether the attribute with the given property name is consideredIRRELEVANTfor the given model object.static booleanisIrrelevant(IModelObject modelObject, PolicyAttribute policyAttribute) Returns whether the given attribute is consideredIRRELEVANTfor the given model object.static booleanisMandatory(IModelObject modelObject, String property) Returns whether the attribute with the given property name is consideredMANDATORYfor the given model object.static booleanisMandatory(IModelObject modelObject, PolicyAttribute policyAttribute) Returns whether the given attribute is consideredMANDATORYfor the given model object.static booleanisOptional(IModelObject modelObject, String property) Returns whether the attribute with the given property name is consideredOPTIONALfor the given model object.static booleanisOptional(IModelObject modelObject, PolicyAttribute policyAttribute) Returns whether the given attribute is consideredOPTIONALfor the given model object.static booleanisRelevant(IModelObject modelObject, String property) Returns whether the attribute with the given property name is considered relevant for the given model object.static booleanisRelevant(IModelObject modelObject, PolicyAttribute policyAttribute) Returns whether the given attribute is considered relevant for the given model object.static Relevanceof(IModelObject modelObject, String property) Returns theRelevanceof thePolicyAttributeidentified by the given property name for the given model object.static Relevanceof(IModelObject modelObject, PolicyAttribute policyAttribute) Returns theRelevanceof the givenPolicyAttributefor the given model object.static RelevanceReturns the enum constant of this type with the specified name.static Relevance[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
IRRELEVANT
An attribute with an empty (ornull) value set - no value should be set. -
OPTIONAL
An attribute with value setcontainingnull- a value can be set but is not required. -
MANDATORY
An attribute with a non-empty value set notcontainingnull- a value must be set.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
isIrrelevant
Returns whether the attribute with the given property name is consideredIRRELEVANTfor the given model object. -
isIrrelevant
Returns whether the given attribute is consideredIRRELEVANTfor the given model object. -
isMandatory
Returns whether the attribute with the given property name is consideredMANDATORYfor the given model object. -
isMandatory
Returns whether the given attribute is consideredMANDATORYfor the given model object. -
isOptional
Returns whether the attribute with the given property name is consideredOPTIONALfor the given model object. -
isOptional
Returns whether the given attribute is consideredOPTIONALfor the given model object. -
isRelevant
Returns whether the attribute with the given property name is considered relevant for the given model object. -
isRelevant
Returns whether the given attribute is considered relevant for the given model object. -
of
Returns theRelevanceof thePolicyAttributeidentified by the given property name for the given model object. -
of
Returns theRelevanceof the givenPolicyAttributefor the given model object. -
asValueSetFor
public <T> org.faktorips.valueset.ValueSet<T> asValueSetFor(IModelObject modelObject, PolicyAttribute policyAttribute) Returns aValueSetfor the given model object's attribute that matches thisRelevance. -
asValueSetFor
public <T> org.faktorips.valueset.ValueSet<T> asValueSetFor(IModelObject modelObject, String property) Returns aValueSetfor the given model object's attribute identified by the given property name that matches thisRelevance. -
asValueSetFor
public abstract <T> org.faktorips.valueset.ValueSet<T> asValueSetFor(IModelObject modelObject, PolicyAttribute policyAttribute, @CheckForNull org.faktorips.valueset.ValueSet<T> values) Returns aValueSetfor the given model object's attribute that matches thisRelevance. If a parent value set is given, the returned value set will be of the same type (if allowed by the attribute'sValueSetKind) and contain no values not allowed by that parent value set (with the exception of a null value if the value set is converted toOPTIONAL).- Parameters:
modelObject- a model objectpolicyAttribute- an attribute present on the model object'sPolicyCmptTypevalues- an optionalValueSet, which can limit the allowed values for the returned value set
-
asValueSetFor
public <T> org.faktorips.valueset.ValueSet<T> asValueSetFor(IModelObject modelObject, PolicyAttribute policyAttribute, @CheckForNull Collection<T> values) Returns aValueSetfor the given model object's attribute that matches thisRelevance. If a parent value set is given, the returned value set will be of the same type (if allowed by the attribute'sValueSetKind) and contain no values not allowed by that parent value set (with the exception of a null value if the value set is converted toOPTIONAL).- Parameters:
modelObject- a model objectpolicyAttribute- an attribute present on the model object'sPolicyCmptTypevalues- the allowed values for the returned value set
-
asValueSetFor
public <T> org.faktorips.valueset.ValueSet<T> asValueSetFor(IModelObject modelObject, String property, @CheckForNull org.faktorips.valueset.ValueSet<T> values) Returns aValueSetfor the given model object's attribute identified by the given property name that matches thisRelevance. If a parent value set is given, the returned value set will be of the same type (if allowed by the attribute'sValueSetKind) and contain no values not allowed by that parent value set (with the exception of a null value if the value set is converted toOPTIONAL).- Parameters:
modelObject- a model objectproperty- the name of an attribute present on the model object'sPolicyCmptTypevalues- an optionalValueSet, which can limit the allowed values for the returned value set
-
asValueSetFor
public <T> org.faktorips.valueset.ValueSet<T> asValueSetFor(IModelObject modelObject, String property, @CheckForNull Collection<T> values) Returns aValueSetfor the given model object's attribute that matches thisRelevance. If a parent value set is given, the returned value set will be of the same type (if allowed by the attribute'sValueSetKind) and contain no values not allowed by that parent value set (with the exception of a null value if the value set is converted toOPTIONAL).- Parameters:
modelObject- a model objectproperty- the name of an attribute present on the model object'sPolicyCmptTypevalues- the allowed values for the returned value set
-