Interface Relation<S extends Resource,T extends Entity>

Type Parameters:
S - The type of the source resource.
T - The type of the target entity.
All Superinterfaces:
Element, ERElement, IdentifiableElement, ModelElement, RelationElement<S,T>, SchemaMixedElement, Serializable
All Known Subinterfaces:
ConsistsOf<S,T>, IsRelatedTo<S,T>
All Known Implementing Classes:
ConsistsOfImpl, DummyIsRelatedTo, IsRelatedToImpl, RelationImpl

@TypeMetadata(name="Relation", description="This is the base type for any Relation", version="1.0.0") @Change(version="1.0.0", description="First Version") public interface Relation<S extends Resource,T extends Entity> extends RelationElement<S,T>, SchemaMixedElement, ERElement
The base interface for all relations in the facet-based resource model.

A relation connects a source Resource to a target Entity and can have its own properties. It supports schema-mixed mode for additional attributes. For more details, refer to the gCube Facet Based Resource Model Wiki.

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

  • Method Details

    • getSource

      S getSource()
      Returns the source entity of the relation.
      Specified by:
      getSource in interface RelationElement<S extends Resource,T extends Entity>
      Returns:
      The source entity.
    • setSource

      void setSource(S source)
      Sets the source entity of the relation.
      Specified by:
      setSource in interface RelationElement<S extends Resource,T extends Entity>
      Parameters:
      source - The source entity to set.
    • getTarget

      T getTarget()
      Returns the target entity of the relation.
      Specified by:
      getTarget in interface RelationElement<S extends Resource,T extends Entity>
      Returns:
      The target entity.
    • setTarget

      void setTarget(T target)
      Sets the target entity of the relation.
      Specified by:
      setTarget in interface RelationElement<S extends Resource,T extends Entity>
      Parameters:
      target - The target entity to set.
    • getPropagationConstraint

      @ISProperty(name="propagationConstraint") PropagationConstraint getPropagationConstraint()
      Returns the propagation constraint for this relation.
      Returns:
      The PropagationConstraint.
    • setPropagationConstraint

      void setPropagationConstraint(PropagationConstraint propagationConstraint)
      Sets the propagation constraint for this relation.
      Parameters:
      propagationConstraint - The PropagationConstraint to set.
    • getAdditionalProperties

      Map<String,Object> getAdditionalProperties()
      Returns a map of all additional properties not defined in the schema.
      Specified by:
      getAdditionalProperties in interface SchemaMixedElement
      Returns:
      A Map containing the additional properties, where the key is the property name and the value is the property value.
    • setAdditionalProperties

      void setAdditionalProperties(Map<String,Object> additionalProperties)
      Sets the map of additional properties for the element.
      Specified by:
      setAdditionalProperties in interface SchemaMixedElement
      Parameters:
      additionalProperties - A Map of additional properties.
    • getAdditionalProperty

      Object getAdditionalProperty(String key)
      Retrieves a single additional property by its key.
      Specified by:
      getAdditionalProperty in interface SchemaMixedElement
      Parameters:
      key - The name of the additional property to retrieve.
      Returns:
      The value of the property, or null if the key is not found.
    • setAdditionalProperty

      void setAdditionalProperty(String key, Object value)
      Sets a single additional property.
      Specified by:
      setAdditionalProperty in interface SchemaMixedElement
      Parameters:
      key - The name of the additional property.
      value - The value of the additional property.