Class Constraints

java.lang.Object
com.dassault_systemes.modeler.sysml.model.Constraints

@OpenApiAll public class Constraints extends Object
  • Constructor Details

    • Constraints

      public Constraints()
  • Method Details

    • isConstraintUsageOrDefinition

      public static boolean isConstraintUsageOrDefinition(@CheckForNull Element element)
      Returns whether the given element is a ConstraintUsage or ConstraintDefinition.
      Parameters:
      element - the element to test
      Returns:
      true if the element is a constraint usage or definition
    • isConstraintUsageOrDefinition

      public static boolean isConstraintUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass)
      Returns whether the given EClass represents a constraint usage or constraint definition.
      Parameters:
      eClass - the class to test
      Returns:
      true if the class is a constraint usage or definition
    • isPureConstraintUsageOrDefinition

      public static boolean isPureConstraintUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass)
      Returns whether the given EClass is exactly the pure ConstraintUsage or ConstraintDefinition type.
      Parameters:
      eClass - the class to test
      Returns:
      true if the class is the pure constraint usage or definition type
    • getOwnedExpressions

      public static Stream<Expression> getOwnedExpressions(ConstraintUsage constraintUsage)
      Returns a stream of all Expression elements owned by the given ConstraintUsage. Includes expressions owned by the constraint definition and the usage itself.

      Special handling is applied for AssertConstraintUsage, which delegates to its asserted constraint.

      Parameters:
      constraintUsage - the constraint usage whose expressions are requested
      Returns:
      a stream of owned expressions
    • isAssumeConstraint

      public static boolean isAssumeConstraint(Element constraint)
      Returns whether the given constraint is an assumption constraint. Assumption constraints are identified through their RequirementConstraintMembership kind.
      Parameters:
      constraint - the constraint element to test
      Returns:
      true if the constraint is an assumption
    • isRequireConstraint

      public static boolean isRequireConstraint(Element constraint)
      Returns whether the given constraint is a requirement constraint. Requirement constraints are identified through their RequirementConstraintMembership kind.
      Parameters:
      constraint - the constraint element to test
      Returns:
      true if the constraint is a requirement
    • isRequirementAssumeOrRequire

      public static boolean isRequirementAssumeOrRequire(@CheckForNull Element constraint)
      Returns whether the given element is a ConstraintUsage that is either an assumption or a requirement constraint.
      Parameters:
      constraint - the element to test
      Returns:
      true if the element is an assume or require constraint