Package org.faktorips.runtime.validation
Enum Relevance
- java.lang.Object
-
- java.lang.Enum<Relevance>
-
- org.faktorips.runtime.validation.Relevance
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Relevance>
public enum Relevance extends java.lang.Enum<Relevance>
Defines the relevance of aPolicyAttribute, derived from itsvalue 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(OPTIONALorMANDATORY) is considered relevant - its value should for example be checked against the value set.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description IRRELEVANTAn attribute with an empty (ornull) value set - no value should be set.MANDATORYAn attribute with a non-empty value set notcontainingnull- a value must be set.OPTIONALAn attribute with value setcontainingnull- a value can be set but is not required.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <T> org.faktorips.valueset.ValueSet<T>asValueSetFor(IModelObject modelObject, java.lang.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, java.lang.String property, java.util.Collection<T> values)Returns aValueSetfor the given model object's attribute that matches thisRelevance.<T> org.faktorips.valueset.ValueSet<T>asValueSetFor(IModelObject modelObject, java.lang.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, java.util.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, java.lang.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, java.lang.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, java.lang.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, java.lang.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, java.lang.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 RelevancevalueOf(java.lang.String name)Returns 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 Detail
-
IRRELEVANT
public static final Relevance IRRELEVANT
An attribute with an empty (ornull) value set - no value should be set.
-
OPTIONAL
public static final Relevance OPTIONAL
An attribute with value setcontainingnull- a value can be set but is not required.
-
MANDATORY
public static final Relevance MANDATORY
An attribute with a non-empty value set notcontainingnull- a value must be set.
-
-
Method Detail
-
values
public static Relevance[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Relevance c : Relevance.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Relevance valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
isIrrelevant
public static boolean isIrrelevant(IModelObject modelObject, java.lang.String property)
Returns whether the attribute with the given property name is consideredIRRELEVANTfor the given model object.
-
isIrrelevant
public static boolean isIrrelevant(IModelObject modelObject, PolicyAttribute policyAttribute)
Returns whether the given attribute is consideredIRRELEVANTfor the given model object.
-
isMandatory
public static boolean isMandatory(IModelObject modelObject, java.lang.String property)
Returns whether the attribute with the given property name is consideredMANDATORYfor the given model object.
-
isMandatory
public static boolean isMandatory(IModelObject modelObject, PolicyAttribute policyAttribute)
Returns whether the given attribute is consideredMANDATORYfor the given model object.
-
isOptional
public static boolean isOptional(IModelObject modelObject, java.lang.String property)
Returns whether the attribute with the given property name is consideredOPTIONALfor the given model object.
-
isOptional
public static boolean isOptional(IModelObject modelObject, PolicyAttribute policyAttribute)
Returns whether the given attribute is consideredOPTIONALfor the given model object.
-
isRelevant
public static boolean isRelevant(IModelObject modelObject, java.lang.String property)
Returns whether the attribute with the given property name is considered relevant for the given model object.
-
isRelevant
public static boolean isRelevant(IModelObject modelObject, PolicyAttribute policyAttribute)
Returns whether the given attribute is considered relevant for the given model object.
-
of
public static Relevance of(IModelObject modelObject, java.lang.String property)
Returns theRelevanceof thePolicyAttributeidentified by the given property name for the given model object.
-
of
public static Relevance of(IModelObject modelObject, PolicyAttribute policyAttribute)
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, java.lang.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 java.util.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, java.lang.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, java.lang.String property, @CheckForNull java.util.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
-
-