2019-10-24 15:03:14 +02:00
|
|
|
package org.gcube.informationsystem.types.reference.relations;
|
|
|
|
|
2019-10-30 09:57:14 +01:00
|
|
|
import java.util.Set;
|
|
|
|
|
2020-07-07 17:04:25 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
|
|
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
2021-02-11 17:24:22 +01:00
|
|
|
import org.gcube.informationsystem.base.reference.AccessType;
|
2020-01-30 10:26:43 +01:00
|
|
|
import org.gcube.informationsystem.base.reference.relations.RelationElement;
|
2019-10-30 09:57:14 +01:00
|
|
|
import org.gcube.informationsystem.types.annotations.ISProperty;
|
2020-01-30 10:26:43 +01:00
|
|
|
import org.gcube.informationsystem.types.impl.relations.RelationTypeImpl;
|
2020-12-15 17:38:06 +01:00
|
|
|
import org.gcube.informationsystem.types.reference.Change;
|
2020-02-03 10:51:29 +01:00
|
|
|
import org.gcube.informationsystem.types.reference.Type;
|
2020-12-15 17:38:06 +01:00
|
|
|
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
2020-01-30 10:26:43 +01:00
|
|
|
import org.gcube.informationsystem.types.reference.entities.EntityType;
|
2019-10-30 09:57:14 +01:00
|
|
|
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
2020-12-15 17:38:06 +01:00
|
|
|
import org.gcube.informationsystem.utils.TypeVersion;
|
2019-10-24 15:03:14 +02:00
|
|
|
|
2021-01-20 17:03:02 +01:00
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
|
|
*/
|
2019-10-24 15:03:14 +02:00
|
|
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
2020-01-30 10:26:43 +01:00
|
|
|
@JsonDeserialize(as = RelationTypeImpl.class)
|
2020-12-15 17:38:06 +01:00
|
|
|
@TypeMetadata(name = RelationType.NAME, description = "This class provides information for any RelationType", version = TypeVersion.MINIMAL_VERSION_STRING)
|
|
|
|
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
2020-01-30 10:26:43 +01:00
|
|
|
public interface RelationType<S extends EntityType, T extends EntityType>
|
2020-02-03 10:51:29 +01:00
|
|
|
extends Type, RelationElement<S,T> {
|
2019-10-24 15:03:14 +02:00
|
|
|
|
2020-01-30 10:26:43 +01:00
|
|
|
public static final String NAME = "RelationType"; // RelationType.class.getSimpleName();
|
2019-10-24 15:03:14 +02:00
|
|
|
|
2019-10-30 09:57:14 +01:00
|
|
|
/* TypeDefinition is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
|
|
|
|
|
|
|
|
@Override
|
2020-02-03 10:51:29 +01:00
|
|
|
@ISProperty(name = Type.NAME_PROPERTY, readonly = true, mandatory = true, nullable = false)
|
2019-10-30 09:57:14 +01:00
|
|
|
public String getName();
|
|
|
|
|
|
|
|
@Override
|
2020-02-03 10:51:29 +01:00
|
|
|
@ISProperty(name = Type.DESCRIPTION_PROPERTY, readonly = false, mandatory = true, nullable = false)
|
2019-10-30 09:57:14 +01:00
|
|
|
public String getDescription();
|
|
|
|
|
|
|
|
@Override
|
2020-02-03 10:51:29 +01:00
|
|
|
@ISProperty(name = Type.ABSTRACT_PROPERTY, readonly = true, mandatory = true, nullable = false)
|
2019-10-30 09:57:14 +01:00
|
|
|
public boolean isAbstract();
|
2020-01-23 17:14:44 +01:00
|
|
|
|
2019-10-30 09:57:14 +01:00
|
|
|
@Override
|
2020-02-03 10:51:29 +01:00
|
|
|
@ISProperty(name = Type.TYPE_SUPERCLASSES_PROPERTY, readonly = true, mandatory = true, nullable = false)
|
2019-10-30 09:57:14 +01:00
|
|
|
public Set<String> getSuperClasses();
|
2020-01-23 17:14:44 +01:00
|
|
|
|
2019-10-30 09:57:14 +01:00
|
|
|
@Override
|
2020-02-03 10:57:41 +01:00
|
|
|
@ISProperty(name = Type.PROPERTIES_PROPERTY, readonly = false, mandatory = true, nullable = false)
|
2019-10-30 09:57:14 +01:00
|
|
|
public Set<PropertyDefinition> getProperties();
|
|
|
|
|
2019-11-04 18:06:46 +01:00
|
|
|
@Override
|
2020-01-23 17:14:44 +01:00
|
|
|
public S getSource();
|
2019-11-04 18:06:46 +01:00
|
|
|
|
|
|
|
@Override
|
2020-01-23 17:14:44 +01:00
|
|
|
public T getTarget();
|
|
|
|
|
2019-10-30 09:57:14 +01:00
|
|
|
/* TypeDefinition is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
|
2019-11-08 12:29:05 +01:00
|
|
|
/*@JsonGetter(value=SOURCE_PROPERTY)
|
2019-10-24 15:03:14 +02:00
|
|
|
public String getSourceType();
|
|
|
|
|
2019-11-08 12:29:05 +01:00
|
|
|
@JsonGetter(value=TARGET_PROPERTY)
|
|
|
|
public String getTargetType();*/
|
2019-10-24 15:03:14 +02:00
|
|
|
|
2021-02-11 17:24:22 +01:00
|
|
|
@Override
|
|
|
|
public default AccessType getAccessType() {
|
|
|
|
return AccessType.RELATION_ELEMENT;
|
|
|
|
}
|
|
|
|
|
2019-10-24 15:03:14 +02:00
|
|
|
}
|