-
- 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
Resourceto a targetEntityand 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:
RelationElement,SchemaMixedElement,ERElement
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAMEThe name of the relation type.static StringPROPAGATION_CONSTRAINT_PROPERTYThe property name for the propagation constraint.-
Fields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, TYPE_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.model.reference.ERElement
CONTEXTS_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.base.reference.IdentifiableElement
ID_PROPERTY, METADATA_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.model.reference.ModelElement
EXPECTED_TYPE_PROPERTY, SUPERTYPES_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.base.reference.relations.RelationElement
SOURCE_PROPERTY, TARGET_PROPERTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,Object>getAdditionalProperties()Returns a map of all additional properties not defined in the schema.ObjectgetAdditionalProperty(String key)Retrieves a single additional property by its key.PropagationConstraintgetPropagationConstraint()Returns the propagation constraint for this relation.SgetSource()Returns the source entity of the relation.TgetTarget()Returns the target entity of the relation.voidsetAdditionalProperties(Map<String,Object> additionalProperties)Sets the map of additional properties for the element.voidsetAdditionalProperty(String key, Object value)Sets a single additional property.voidsetPropagationConstraint(PropagationConstraint propagationConstraint)Sets the propagation constraint for this relation.voidsetSource(S source)Sets the source entity of the relation.voidsetTarget(T target)Sets the target entity of the relation.-
Methods inherited from interface org.gcube.informationsystem.base.reference.Element
getTypeName
-
Methods inherited from interface org.gcube.informationsystem.model.reference.ERElement
getContexts
-
Methods inherited from interface org.gcube.informationsystem.model.reference.ModelElement
getExpectedtype, getSupertypes
-
Methods inherited from interface org.gcube.informationsystem.base.reference.relations.RelationElement
getID, getMetadata, setID, setMetadata
-
-
-
-
Field Detail
-
NAME
static final String NAME
The name of the relation type.- See Also:
- Constant Field Values
-
PROPAGATION_CONSTRAINT_PROPERTY
static final String PROPAGATION_CONSTRAINT_PROPERTY
The property name for the propagation constraint.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSource
S getSource()
Returns the source entity of the relation.
-
setSource
void setSource(S source)
Sets the source entity of the relation.
-
getTarget
T getTarget()
Returns the target entity of the relation.
-
setTarget
void setTarget(T target)
Sets the target entity of the relation.
-
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- ThePropagationConstraintto set.
-
getAdditionalProperties
Map<String,Object> getAdditionalProperties()
Returns a map of all additional properties not defined in the schema.- Specified by:
getAdditionalPropertiesin interfaceSchemaMixedElement- Returns:
- A
Mapcontaining 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:
setAdditionalPropertiesin interfaceSchemaMixedElement- Parameters:
additionalProperties- AMapof additional properties.
-
getAdditionalProperty
Object getAdditionalProperty(String key)
Retrieves a single additional property by its key.- Specified by:
getAdditionalPropertyin interfaceSchemaMixedElement- Parameters:
key- The name of the additional property to retrieve.- Returns:
- The value of the property, or
nullif the key is not found.
-
setAdditionalProperty
void setAdditionalProperty(String key, Object value)
Sets a single additional property.- Specified by:
setAdditionalPropertyin interfaceSchemaMixedElement- Parameters:
key- The name of the additional property.value- The value of the additional property.
-
-