Interface RelationElement<S extends EntityElement,T extends EntityElement>
-
- Type Parameters:
S- The type of the source entity.T- The type of the target entity.
- All Superinterfaces:
Element,IdentifiableElement,Serializable
- All Known Subinterfaces:
ConsistsOf<S,T>,ConsistsOfType,IsParentOf,IsRelatedTo<S,T>,IsRelatedToType,Relation<S,T>,RelationType<S,T>
- All Known Implementing Classes:
ConsistsOfImpl,ConsistsOfTypeImpl,DummyIsRelatedTo,IsParentOfImpl,IsRelatedToImpl,IsRelatedToTypeImpl,RelationElementImpl,RelationImpl,RelationTypeImpl
@TypeMetadata(name="RelationElement", description="This is the base type for any RelationElement", version="1.0.0") @Change(version="1.0.0", description="First Version") public interface RelationElement<S extends EntityElement,T extends EntityElement> extends Element, IdentifiableElement
The base interface for all relation elements in the Information System model.This interface defines a directed relationship between a source and a target entity, both of which must be subtypes of
EntityElement. It extendsIdentifiableElementto ensure that every relation is uniquely identifiable.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAMEThe name of the relation element type.static StringSOURCE_PROPERTYThe property name for the source of the relation.static StringTARGET_PROPERTYThe property name for the target of the relation.-
Fields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, TYPE_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.base.reference.IdentifiableElement
ID_PROPERTY, METADATA_PROPERTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UUIDgetID()Returns the unique identifier (UUID) of the element.MetadatagetMetadata()Returns the metadata associated with the element.SgetSource()Returns the source entity of the relation.TgetTarget()Returns the target entity of the relation.voidsetID(UUID uuid)Sets the unique identifier (UUID) for the element.voidsetMetadata(Metadata metadata)Sets the metadata for the element.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
-
-
-
-
Field Detail
-
NAME
static final String NAME
The name of the relation element type.- See Also:
- Constant Field Values
-
SOURCE_PROPERTY
static final String SOURCE_PROPERTY
The property name for the source of the relation.- See Also:
- Constant Field Values
-
TARGET_PROPERTY
static final String TARGET_PROPERTY
The property name for the target of the relation.- See Also:
- Constant Field Values
-
-
Method Detail
-
getID
@ISProperty(name="id", description="This UUID is be used to identify the instance univocally.", readonly=true, mandatory=true, nullable=false) UUID getID()
Returns the unique identifier (UUID) of the element.This UUID is used to uniquely identify the relation instance. It is read-only, mandatory, and cannot be null.
- Specified by:
getIDin interfaceIdentifiableElement- Returns:
- The
UUIDof the element.
-
setID
void setID(UUID uuid)
Sets the unique identifier (UUID) for the element.- Specified by:
setIDin interfaceIdentifiableElement- Parameters:
uuid- TheUUIDto set.
-
getMetadata
@ISProperty(name="metadata", mandatory=true, nullable=false, description="Metadata associated with the instance that is automatically created/updated by the system.") Metadata getMetadata()
Returns the metadata associated with the element.The metadata is included in JSON serialization only if it is not null.
Metadata is automatically managed by the system and is mandatory.
- Specified by:
getMetadatain interfaceIdentifiableElement- Returns:
- The
Metadataof the element, ornullif none is set.
-
setMetadata
void setMetadata(Metadata metadata)
Sets the metadata for the element.- Specified by:
setMetadatain interfaceIdentifiableElement- Parameters:
metadata- TheMetadatato associate with the element.
-
getSource
S getSource()
Returns the source entity of the relation.- Returns:
- The source entity.
-
setSource
void setSource(S source)
Sets the source entity of the relation.- Parameters:
source- The source entity to set.
-
getTarget
T getTarget()
Returns the target entity of the relation.- Returns:
- The target entity.
-
setTarget
void setTarget(T target)
Sets the target entity of the relation.- Parameters:
target- The target entity to set.
-
-