Class RelationTypeImpl<S extends EntityType,T extends EntityType>
- java.lang.Object
-
- org.gcube.informationsystem.types.impl.TypeImpl
-
- org.gcube.informationsystem.types.impl.relations.RelationTypeImpl<S,T>
-
- Type Parameters:
S- the source typeT- the target type
- All Implemented Interfaces:
Serializable,Element,IdentifiableElement,RelationElement<S,T>,RelationType<S,T>,Type
- Direct Known Subclasses:
ConsistsOfTypeImpl,IsRelatedToTypeImpl
public class RelationTypeImpl<S extends EntityType,T extends EntityType> extends TypeImpl implements RelationType<S,T>
The implementation of theRelationType.- 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, changelog, DEFAULT_CHANGELOG_MAP, description, extendedTypes, finalClass, metadata, name, properties, uuid, version
-
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
-
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.RelationType
NAME
-
Fields inherited from interface org.gcube.informationsystem.types.reference.Type
ABSTRACT_PROPERTY, CHANGELOG_PROPERTY, DESCRIPTION_PROPERTY, EXTENDED_TYPES_PROPERTY, FINAL_PROPERTY, NAME, NAME_PROPERTY, PROPERTIES_PROPERTY, VERSION_PROPERTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRelationTypeImpl()Default constructor.RelationTypeImpl(Class<? extends RelationElement<?,?>> clz)Constructs a newRelationTypeImplfrom 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 RelationType<?,?>getRelationTypeDefinitionInstance(Class<? extends RelationElement<?,?>> clz)Returns aRelationTypeinstance 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
getChangelog, getChangelogWithVersionAsString, getDescription, getExtendedTypes, getGenericClass, getID, getInstance, getMetadata, getName, getProperties, getTypeName, getVersion, getVersionAsString, isAbstract, isFinal, retrieveListOfProperties, retrieveSuperClasses, setChangelog, setID, 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.RelationType
getDescription, getExtendedTypes, getName, getProperties, isAbstract
-
Methods inherited from interface org.gcube.informationsystem.types.reference.Type
getChangelog, getChangelogWithVersionAsString, getID, getMetadata, getVersion, getVersionAsString, isFinal, setID, setMetadata
-
-
-
-
Field Detail
-
source
protected S extends EntityType source
The source of the relation.
-
target
protected T extends EntityType target
The target of the relation.
-
-
Constructor Detail
-
RelationTypeImpl
protected RelationTypeImpl()
Default constructor.
-
RelationTypeImpl
public RelationTypeImpl(Class<? extends RelationElement<?,?>> clz)
Constructs a newRelationTypeImplfrom a class.- Parameters:
clz- The class.
-
-
Method Detail
-
getRelationTypeDefinitionInstance
public static RelationType<?,?> getRelationTypeDefinitionInstance(Class<? extends RelationElement<?,?>> clz)
Returns aRelationTypeinstance for the given class.- Parameters:
clz- the class- Returns:
- a
RelationTypeinstance
-
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 EntityType,T extends EntityType>- Specified by:
getSourcein interfaceRelationType<S extends EntityType,T extends EntityType>- Returns:
- The source entity.
-
setSource
public void setSource(S source)
Sets the source entity of the relation.- Specified by:
setSourcein interfaceRelationElement<S extends EntityType,T extends EntityType>- Parameters:
source- The source entity to set.
-
getTarget
public T getTarget()
Returns the target entity of the relation.- Specified by:
getTargetin interfaceRelationElement<S extends EntityType,T extends EntityType>- Specified by:
getTargetin interfaceRelationType<S extends EntityType,T extends EntityType>- Returns:
- The target entity.
-
setTarget
public void setTarget(T target)
Sets the target entity of the relation.- Specified by:
setTargetin interfaceRelationElement<S extends EntityType,T extends EntityType>- 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.
-
-