information-system-model/src/main/java/org/gcube/informationsystem/types/reference/relations/RelationTypeDefinition.java

67 lines
2.4 KiB
Java
Raw Normal View History

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;
2019-10-24 15:03:14 +02:00
import org.gcube.informationsystem.base.reference.entities.BaseEntity;
import org.gcube.informationsystem.base.reference.relations.BaseRelation;
2019-10-30 09:57:14 +01:00
import org.gcube.informationsystem.types.annotations.ISProperty;
2019-10-24 15:03:14 +02:00
import org.gcube.informationsystem.types.impl.relations.RelationTypeDefinitionImpl;
import org.gcube.informationsystem.types.reference.TypeDefinition;
import org.gcube.informationsystem.types.reference.entities.EntityTypeDefinition;
2019-10-30 09:57:14 +01:00
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
2019-10-24 15:03:14 +02:00
2019-11-04 18:06:46 +01:00
import com.fasterxml.jackson.annotation.JsonIgnore;
2019-10-24 15:03:14 +02:00
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonDeserialize(as = RelationTypeDefinitionImpl.class)
2019-11-04 18:06:46 +01:00
public interface RelationTypeDefinition<ES extends EntityTypeDefinition<S>, ET extends EntityTypeDefinition<T>, S extends BaseEntity, T extends BaseEntity>
extends TypeDefinition, BaseRelation<ES,ET> {
2019-10-24 15:03:14 +02:00
public static final String NAME = "RelationTypeDefinition"; // PropertyTypeDefiniton.class.getSimpleName();
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
@ISProperty(name = TypeDefinition.NAME_PROPERTY, readonly = true, mandatory = true, nullable = false)
public String getName();
@Override
@ISProperty(name = TypeDefinition.DESCRIPTION_PROPERTY, readonly = false, mandatory = true, nullable = false)
public String getDescription();
@Override
@ISProperty(name = TypeDefinition.ABSTRACT_PROPERTY, readonly = true, mandatory = true, nullable = false)
public boolean isAbstract();
@Override
@ISProperty(name = TypeDefinition.TYPE_SUPERCLASSES_PROPERTY, readonly = true, mandatory = true, nullable = false)
public Set<String> getSuperClasses();
@Override
@ISProperty(name = TypeDefinition.PROPERTIES_PROPERTY, readonly = false, mandatory = true, nullable = false)
public Set<PropertyDefinition> getProperties();
2019-11-04 18:06:46 +01:00
/*
@Override
@JsonIgnore
public Header getHeader();
*/
@Override
@JsonIgnore
public ES getSource();
@Override
@JsonIgnore
public ET 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-10-24 15:03:14 +02:00
public String getSourceType();
public String getTargetType();
}