Class RelationSchemaImpl<S extends EntitySchema,T extends EntitySchema>
- java.lang.Object
-
- org.gcube.informationsystem.types.impl.TypeImpl
-
- org.gcube.informationsystem.types.impl.relations.RelationSchemaImpl<S,T>
-
- Type Parameters:
S- the source typeT- the target type
- All Implemented Interfaces:
Serializable,Element,IdentifiableElement,RelationElement<S,T>,RelationSchema<S,T>,Type
- Direct Known Subclasses:
ConsistsOfSchemaImpl,IsRelatedToSchemaImpl
public class RelationSchemaImpl<S extends EntitySchema,T extends EntitySchema> extends TypeImpl implements RelationSchema<S,T>
The implementation of theRelationSchema.- Author:
- Luca Frosini (ISTI - CNR), F. R. Pisano (ISTI - CNR)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SsourceThe source of the relation.protected TtargetThe target of the relation.-
Fields inherited from class org.gcube.informationsystem.types.impl.TypeImpl
abstractType, additionalProperties, changelog, DEFAULT_CHANGELOG_MAP, description, extendedTypes, finalClass, locked, metadata, name, properties, uuid, version
-
Fields inherited from interface org.gcube.informationsystem.base.reference.Element
DATETIME_PATTERN, REDACTED, TYPE_PROPERTY, UNKNOWN_USER
-
Fields inherited from interface org.gcube.informationsystem.base.reference.IdentifiableElement
ID_PROPERTY, METADATA_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.base.reference.relations.RelationElement
SOURCE_PROPERTY, TARGET_PROPERTY
-
Fields inherited from interface org.gcube.informationsystem.types.reference.relations.RelationSchema
NAME
-
Fields inherited from interface org.gcube.informationsystem.types.reference.Type
ABSTRACT_PROPERTY, CHANGELOG_PROPERTY, DESCRIPTION_PROPERTY, EXTENDED_TYPES_PROPERTY, FINAL_PROPERTY, LOCKED_PROPERTY, NAME, NAME_PROPERTY, NAME_REGEX, PROPERTIES_PROPERTY, VERSION_PROPERTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRelationSchemaImpl()Default constructor.RelationSchemaImpl(Class<? extends RelationElement<?,?>> clz)Constructs a newRelationSchemaImplfrom a class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessTypegetAccessType()Returns theAccessTypeof this type definition.protected Type[]getParametersFromSuperClasses(Class<? extends RelationElement<?,?>> clz)Returns the generic parameters from the superclasses of the given class.static RelationSchema<?,?>getRelationSchemaInstance(Class<? extends RelationElement<?,?>> clz)Returns aRelationSchemainstance for the given class.SgetSource()Returns the source entity of the relation.TgetTarget()Returns the target entity of the relation.voidsetSource(S source)Sets the source entity of the relation.voidsetTarget(T target)Sets the target entity of the relation.StringtoString()-
Methods inherited from class org.gcube.informationsystem.types.impl.TypeImpl
getAdditionalProperties, getChangelog, getChangelogWithVersionAsString, getDescription, getExtendedTypes, getGenericClass, getID, getInstance, getMetadata, getName, getProperties, getTypeName, getVersion, getVersionAsString, isAbstract, isFinal, isLocked, retrieveListOfProperties, retrieveSuperClasses, setAdditionalProperty, setChangelog, setExtendedTypes, setID, setLocked, setMetadata, setVersion
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.gcube.informationsystem.base.reference.Element
getTypeName
-
Methods inherited from interface org.gcube.informationsystem.base.reference.relations.RelationElement
getID, getMetadata, setID, setMetadata
-
Methods inherited from interface org.gcube.informationsystem.types.reference.relations.RelationSchema
getDescription, getExtendedTypes, getName, getProperties, isAbstract
-
Methods inherited from interface org.gcube.informationsystem.types.reference.Type
getAdditionalProperties, getChangelog, getChangelogWithVersionAsString, getID, getMetadata, getVersion, getVersionAsString, isFinal, isLocked, setAdditionalProperty, setExtendedTypes, setID, setLocked, setMetadata
-
-
-
-
Field Detail
-
source
protected S extends EntitySchema source
The source of the relation.
-
target
protected T extends EntitySchema target
The target of the relation.
-
-
Constructor Detail
-
RelationSchemaImpl
protected RelationSchemaImpl()
Default constructor.
-
RelationSchemaImpl
public RelationSchemaImpl(Class<? extends RelationElement<?,?>> clz)
Constructs a newRelationSchemaImplfrom a class.- Parameters:
clz- The class.
-
-
Method Detail
-
getRelationSchemaInstance
public static RelationSchema<?,?> getRelationSchemaInstance(Class<? extends RelationElement<?,?>> clz)
Returns aRelationSchemainstance for the given class.- Parameters:
clz- the class- Returns:
- a
RelationSchemainstance
-
getParametersFromSuperClasses
protected Type[] getParametersFromSuperClasses(Class<? extends RelationElement<?,?>> clz)
Returns the generic parameters from the superclasses of the given class.- Parameters:
clz- the class- Returns:
- the generic parameters
-
getSource
public S getSource()
Returns the source entity of the relation.- Specified by:
getSourcein interfaceRelationElement<S extends EntitySchema,T extends EntitySchema>- Specified by:
getSourcein interfaceRelationSchema<S extends EntitySchema,T extends EntitySchema>- Returns:
- The source entity.
-
setSource
public void setSource(S source)
Sets the source entity of the relation.- Specified by:
setSourcein interfaceRelationElement<S extends EntitySchema,T extends EntitySchema>- Parameters:
source- The source entity to set.
-
getTarget
public T getTarget()
Returns the target entity of the relation.- Specified by:
getTargetin interfaceRelationElement<S extends EntitySchema,T extends EntitySchema>- Specified by:
getTargetin interfaceRelationSchema<S extends EntitySchema,T extends EntitySchema>- Returns:
- The target entity.
-
setTarget
public void setTarget(T target)
Sets the target entity of the relation.- Specified by:
setTargetin interfaceRelationElement<S extends EntitySchema,T extends EntitySchema>- Parameters:
target- The target entity to set.
-
getAccessType
public AccessType getAccessType()
Returns theAccessTypeof this type definition.- Specified by:
getAccessTypein interfaceType- Overrides:
getAccessTypein classTypeImpl- Returns:
- The access type.
-
-