Class FeatureValues

java.lang.Object
com.dassault_systemes.modeler.kerml.model.FeatureValues

@OpenApiAll public class FeatureValues extends Object
Utility class to work with FeatureValue
  • Constructor Details

    • FeatureValues

      public FeatureValues()
  • Method Details

    • getOwnedFeatureValue

      @CheckForNull public static FeatureValue getOwnedFeatureValue(Feature feature)
      Returns the owned feature value of the given feature.
      Parameters:
      feature - the feature
      Returns:
      owned feature value, or null
    • hasBindingFeatureValue

      public static boolean hasBindingFeatureValue(Feature feature)
      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

      public static boolean hasOwnedFeatureValue(Feature feature)
      Checks whether the feature has any owned feature value.
      Parameters:
      feature - the feature
      Returns:
      true if an owned feature value exists
    • getValueExpression

      @CheckForNull public static Expression getValueExpression(Feature feature)
      Returns the effective value expression of the feature, considering redefinitions.
      Parameters:
      feature - the feature
      Returns:
      value expression, or null
    • getOwnedFeatureValueExpression

      @CheckForNull public static Expression getOwnedFeatureValueExpression(Feature feature)
      Returns the value expression of the owned feature value.
      Parameters:
      feature - the feature
      Returns:
      value expression, or null
    • isApplicable

      public static boolean isApplicable(Feature feature)
      Checks whether the feature is allowed to have a feature value.
      Parameters:
      feature - the feature
      Returns:
      true if applicable
    • hasInitialFeatureValue

      public static boolean hasInitialFeatureValue(Feature feature)
      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 type
      feature - the feature being redefined
      value - 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 type
      feature - the feature being redefined
      redefiningECLassSupplier - supplier for redefining feature class
      value - value to assign
      Returns:
      created or updated feature value, or null
    • setValue

      @CheckForNull public static FeatureValue setValue(Feature feature, @CheckForNull Object value)
      Sets or clears the feature value of the given feature. Creates a new FeatureValue if needed.
      Parameters:
      feature - the feature
      value - literal value or expression
      Returns:
      created or updated feature value, or null if removed