Class Payloads
java.lang.Object
com.dassault_systemes.modeler.kerml.model.Payloads
Utility class to work with payloads in
Flow-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordImmutable container for directional payload features. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FeaturegetPayload(Type type) Returns the payload feature of the given type, if any.static FeaturegetPayload(PayloadsParams params) Resolves the payload feature for the flow-like type described by the given parameters.static Payloads.FeaturesgetPayloadFeatures(Type relationship, Feature end) Returns payload features for a relationship relative to a specific end.static Payloads.FeaturesgetPayloadFeaturesForBinary(Type relationship) Returns payload features for a binary relationship (exactly two ends).static booleanChecks whether the given feature is a payload feature.
-
Constructor Details
-
Payloads
public Payloads()
-
-
Method Details
-
getPayloadFeaturesForBinary
Returns payload features for a binary relationship (exactly two ends). Payloads are grouped into source→target and target→source directions.- Parameters:
relationship- the relationship whose payloads are requested- Returns:
- a Features object containing directional payload lists
-
getPayloadFeatures
Returns payload features for a relationship relative to a specific end. Payloads are grouped into source→target and target→source directions.- Parameters:
relationship- the relationship whose payloads are requestedend- the end feature used as reference- Returns:
- a Features object containing directional payload lists
-
isPayload
Checks whether the given feature is a payload feature.- Parameters:
feature- the feature to check- Returns:
- true if the feature is a payload
-
getPayload
Returns the payload feature of the given type, if any.- Parameters:
type- the type to inspect- Returns:
- the payload feature, or null if none exists
-
getPayload
Resolves the payload feature for the flow-like type described by the given parameters.This method performs a multi‑step lookup:
- If the type is a
Flow, its explicitly declared payload feature is returned. - Otherwise, the method attempts to locate an owned feature whose type matches the standard library payload type (or a redefinition of it).
- If no owned payload is found, inherited features are searched, subject to standard library filtering rules.
- If
createis enabled in the parameters, a new payload feature is created, optionally redefining an inherited payload.
This method supports advanced scenarios such as:
- distinguishing between owned and inherited payloads,
- respecting standard library boundaries,
- creating redefining payload features when needed, and
- handling both
PayloadFeatureinstances and typed features.
If no payload can be resolved and creation is not requested, this method returns
null.- Parameters:
params- configuration describing how payload lookup and creation should behave- Returns:
- the resolved or newly created payload feature, or
nullif none exists
- If the type is a
-