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

@OpenApiAll public class Subjects extends Object
Utility class providing helper methods for working with Subjects
  • Constructor Details

    • Subjects

      public Subjects()
  • Method Details

    • createSubject

      public static Usage createSubject(Type type, int relationshipPosition)
      Creates a new subject parameter on the given type at the specified relationship position. The subject is represented as a ReferenceUsage with FeatureDirectionKind.IN direction, owned through a SubjectMembership.
      Parameters:
      type - the type on which the subject is created
      relationshipPosition - index at which the membership is inserted, or a negative value to append
      Returns:
      the created subject parameter
    • getOwnedSubjectParameter

      @CheckForNull public static Usage getOwnedSubjectParameter(Type type)
      Returns the subject parameter owned by the given type, if any.
      Parameters:
      type - the type
      Returns:
      subject parameter, or null if none exists
    • getOwnedSubjectParameterValue

      @CheckForNull public static Expression getOwnedSubjectParameterValue(Type type)
      Returns the value expression of the owned subject parameter, if any.
      Parameters:
      type - the type
      Returns:
      value expression, or null if none exists
    • getOwnedSubjectParameterOwnedValue

      @CheckForNull public static Expression getOwnedSubjectParameterOwnedValue(Type type)
      Returns the owned value expression of the subject parameter, if any. This retrieves the expression directly owned by the feature value.
      Parameters:
      type - the type
      Returns:
      owned value expression, or null if none exists
    • isSubject

      public static boolean isSubject(Feature feature)
      Checks whether the given feature is a subject parameter.
      Parameters:
      feature - the feature
      Returns:
      true if the feature is a subject parameter
    • isSubject

      public static boolean isSubject(@CheckForNull FeatureMembership membership)
      Checks whether the given membership represents a subject membership.
      Parameters:
      membership - the membership
      Returns:
      true if the membership is a SubjectMembership
    • getSubjectParameter

      @CheckForNull public static Usage getSubjectParameter(@CheckForNull Type type)
      Returns the subject parameter of the given type, if the type supports subject parameters (e.g., requirements and cases).
      Parameters:
      type - the type
      Returns:
      subject parameter, or null if none exists