Class RelationImpl<S extends Resource,T extends Entity>

All Implemented Interfaces:
Serializable, Element, IdentifiableElement, RelationElement<S,T>, SchemaMixedElement, ERElement, ModelElement, Relation<S,T>
Direct Known Subclasses:
ConsistsOfImpl, IsRelatedToImpl

public abstract class RelationImpl<S extends Resource,T extends Entity> extends RelationElementImpl<S,T> implements Relation<S,T>
The default abstract implementation of the Relation interface.

Upon instantiation, a unique, non-reserved identifier (UUID) is automatically generated and assigned by default, purely as a convenience so that callers are not forced to set an id explicitly on every instance. This default does not by itself provide idempotency across retries (e.g. of a PUT): a caller that needs the server to recognize a retried request as the same logical instance must capture and reuse an explicit UUID via RelationElementImpl.setID(UUID) — a freshly constructed instance always receives a new random id.

Author:
Luca Frosini (ISTI - CNR)
See Also:
  • Field Details

    • supertypes

      protected List<String> supertypes
      The supertypes of the relation.
    • expectedtype

      protected String expectedtype
      The expected type of the relation.
    • contexts

      protected Map<UUID,String> contexts
      The contexts of the relation.
    • propagationConstraint

      protected PropagationConstraint propagationConstraint
      The propagation constraint of the relation.
    • additionalProperties

      protected Map<String,Object> additionalProperties
      The additional properties of the relation.
    • allowedAdditionalKeys

      protected final Set<String> allowedAdditionalKeys
      A set of keys that are allowed as additional properties, even if they start with '_' or '@'.
  • Constructor Details

    • RelationImpl

      protected RelationImpl()
      Default constructor. Initializes the relation with an automatically generated, valid, and non-reserved UUID so that callers are not forced to set one explicitly. The identifier can be overridden using the setter, e.g. when the caller needs idempotency across retries.
    • RelationImpl

      protected RelationImpl(S source, T target, PropagationConstraint propagationConstraint)
      Constructs a new RelationImpl with the given source, target, and propagation constraint.
      Parameters:
      source - The source of the relation.
      target - The target of the relation.
      propagationConstraint - The propagation constraint of the relation.
  • Method Details