java.lang.Object
org.gcube.informationsystem.base.impl.ElementImpl
org.gcube.informationsystem.base.impl.relations.RelationElementImpl<S,T>
org.gcube.informationsystem.model.impl.relations.RelationImpl<S,T>
- 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.- Author:
- Luca Frosini (ISTI - CNR)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe additional properties of the relation.A set of keys that are allowed as additional properties, even if they start with '_' or '@'.The contexts of the relation.protected StringThe expected type of the relation.protected PropagationConstraintThe propagation constraint of the relation.The supertypes of the relation.Fields inherited from class org.gcube.informationsystem.base.impl.relations.RelationElementImpl
metadata, source, target, uuidFields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, NAME, TYPE_PROPERTYFields inherited from interface org.gcube.informationsystem.model.reference.ERElement
CONTEXTS_PROPERTYFields inherited from interface org.gcube.informationsystem.base.reference.IdentifiableElement
ID_PROPERTY, METADATA_PROPERTYFields inherited from interface org.gcube.informationsystem.model.reference.ModelElement
EXPECTED_TYPE_PROPERTY, SUPERTYPES_PROPERTYFields inherited from interface org.gcube.informationsystem.model.reference.relations.Relation
NAME, PROPAGATION_CONSTRAINT_PROPERTYFields inherited from interface org.gcube.informationsystem.base.reference.relations.RelationElement
NAME, SOURCE_PROPERTY, TARGET_PROPERTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor.protectedRelationImpl(S source, T target, PropagationConstraint propagationConstraint) Constructs a newRelationImplwith the given source, target, and propagation constraint. -
Method Summary
Modifier and TypeMethodDescriptionReturns a map of all additional properties not defined in the schema.Retrieves a single additional property by its key.Returns a map of contexts where this element is present.Returns the name of the expected type.Returns the propagation constraint for this relation.Returns the list of supertypes for this element.voidsetAdditionalProperties(Map<String, Object> additionalProperties) Sets the map of additional properties for the element.voidsetAdditionalProperty(String key, Object value) Sets a single additional property.protected voidsetContexts(Map<UUID, String> contexts) Sets the contexts of the relation.voidsetPropagationConstraint(PropagationConstraint propagationConstraint) Sets the propagation constraint for this relation.Methods inherited from class org.gcube.informationsystem.base.impl.relations.RelationElementImpl
getID, getMetadata, getSource, getTarget, setID, setMetadata, setSource, setTargetMethods inherited from class org.gcube.informationsystem.base.impl.ElementImpl
getTypeName, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.gcube.informationsystem.base.reference.Element
getTypeNameMethods inherited from interface org.gcube.informationsystem.model.reference.relations.Relation
getSource, getTarget, setSource, setTargetMethods inherited from interface org.gcube.informationsystem.base.reference.relations.RelationElement
getID, getMetadata, setID, setMetadata
-
Field Details
-
supertypes
The supertypes of the relation. -
expectedtype
The expected type of the relation. -
contexts
The contexts of the relation. -
propagationConstraint
The propagation constraint of the relation. -
additionalProperties
The additional properties of the relation. -
allowedAdditionalKeys
A set of keys that are allowed as additional properties, even if they start with '_' or '@'.
-
-
Constructor Details
-
RelationImpl
protected RelationImpl()Default constructor. -
RelationImpl
Constructs a newRelationImplwith 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
-
getSupertypes
Returns the list of supertypes for this element.This list is included in JSON serialization only if it is not empty.
- Specified by:
getSupertypesin interfaceModelElement- Returns:
- A
Listof supertype names.
-
getExpectedtype
Returns the name of the expected type.This is used during deserialization to indicate the original type when a fallback to a supertype was necessary. It is included in JSON serialization only if it is not empty.
- Specified by:
getExpectedtypein interfaceModelElement- Returns:
- The expected type name.
-
getContexts
Returns a map of contexts where this element is present.The map keys are the context UUIDs, and the values are the context names. This property is included in JSON serialization only if it is not null.
- Specified by:
getContextsin interfaceERElement- Returns:
- A
Mapof context UUIDs to context names, ornull.
-
setContexts
Sets the contexts of the relation.- Parameters:
contexts- The contexts to set.
-
getPropagationConstraint
Returns the propagation constraint for this relation.- Specified by:
getPropagationConstraintin interfaceRelation<S extends Resource,T extends Entity> - Returns:
- The
PropagationConstraint.
-
setPropagationConstraint
Sets the propagation constraint for this relation.- Specified by:
setPropagationConstraintin interfaceRelation<S extends Resource,T extends Entity> - Parameters:
propagationConstraint- ThePropagationConstraintto set.
-
getAdditionalProperties
Returns a map of all additional properties not defined in the schema.- Specified by:
getAdditionalPropertiesin interfaceRelation<S extends Resource,T extends Entity> - 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
Sets the map of additional properties for the element.- Specified by:
setAdditionalPropertiesin interfaceRelation<S extends Resource,T extends Entity> - Specified by:
setAdditionalPropertiesin interfaceSchemaMixedElement- Parameters:
additionalProperties- AMapof additional properties.
-
getAdditionalProperty
Retrieves a single additional property by its key.- Specified by:
getAdditionalPropertyin interfaceRelation<S extends Resource,T extends Entity> - 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
Sets a single additional property.- Specified by:
setAdditionalPropertyin interfaceRelation<S extends Resource,T extends Entity> - Specified by:
setAdditionalPropertyin interfaceSchemaMixedElement- Parameters:
key- The name of the additional property.value- The value of the additional property.
-