Class FeatureValues
java.lang.Object
com.dassault_systemes.modeler.kerml.model.FeatureValues
Utility class to work with
FeatureValue-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FeatureValuegetOwnedFeatureValue(Feature feature) Returns the owned feature value of the given feature.static ExpressiongetOwnedFeatureValueExpression(Feature feature) Returns the value expression of the owned feature value.static ExpressiongetValueExpression(Feature feature) Returns the effective value expression of the feature, considering redefinitions.static booleanhasBindingFeatureValue(Feature feature) Checks whether the feature has a binding (non‑initial, non‑default) feature value.static booleanhasInitialFeatureValue(Feature feature) Checks whether the feature has an initial feature value.static booleanhasOwnedFeatureValue(Feature feature) Checks whether the feature has any owned feature value.static booleanisApplicable(Feature feature) Checks whether the feature is allowed to have a feature value.static FeatureValueSets or clears the feature value of the given feature.static FeatureValueSets a feature value by creating or reusing a redefining feature.static FeatureValuesetValue(Type type, Feature feature, Supplier<org.eclipse.emf.ecore.EClass> redefiningECLassSupplier, Object value) Sets a feature value using a custom redefining feature class supplier.
-
Constructor Details
-
FeatureValues
public FeatureValues()
-
-
Method Details
-
getOwnedFeatureValue
Returns the owned feature value of the given feature.- Parameters:
feature- the feature- Returns:
- owned feature value, or null
-
hasBindingFeatureValue
Checks whether the feature has a binding (non‑initial, non‑default) feature value.- Parameters:
feature- the feature- Returns:
- true if a binding feature value exists
-
hasOwnedFeatureValue
Checks whether the feature has any owned feature value.- Parameters:
feature- the feature- Returns:
- true if an owned feature value exists
-
getValueExpression
Returns the effective value expression of the feature, considering redefinitions.- Parameters:
feature- the feature- Returns:
- value expression, or null
-
getOwnedFeatureValueExpression
Returns the value expression of the owned feature value.- Parameters:
feature- the feature- Returns:
- value expression, or null
-
isApplicable
Checks whether the feature is allowed to have a feature value.- Parameters:
feature- the feature- Returns:
- true if applicable
-
hasInitialFeatureValue
Checks whether the feature has an initial feature value.- Parameters:
feature- the feature- Returns:
- true if the feature value is initial
-
setValue
@CheckForNull public static FeatureValue setValue(Type type, Feature feature, @CheckForNull Object value) Sets a feature value by creating or reusing a redefining feature.- Parameters:
type- the owning typefeature- the feature being redefinedvalue- value to assign- Returns:
- created or updated feature value, or null
-
setValue
@CheckForNull public static FeatureValue setValue(Type type, Feature feature, Supplier<org.eclipse.emf.ecore.EClass> redefiningECLassSupplier, @CheckForNull Object value) Sets a feature value using a custom redefining feature class supplier.- Parameters:
type- the owning typefeature- the feature being redefinedredefiningECLassSupplier- supplier for redefining feature classvalue- value to assign- Returns:
- created or updated feature value, or null
-
setValue
Sets or clears the feature value of the given feature. Creates a new FeatureValue if needed.- Parameters:
feature- the featurevalue- literal value or expression- Returns:
- created or updated feature value, or null if removed
-