information-system-model/src/main/java/org/gcube/informationsystem/base/reference/relations/RelationElement.java

43 lines
1.8 KiB
Java
Raw Normal View History

package org.gcube.informationsystem.base.reference.relations;
2020-07-07 17:04:25 +02:00
import org.gcube.com.fasterxml.jackson.annotation.JsonGetter;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
2020-02-03 10:51:29 +01:00
import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.base.reference.IdentifiableElement;
import org.gcube.informationsystem.base.reference.entities.EntityElement;
2020-01-20 10:24:55 +01:00
import org.gcube.informationsystem.model.reference.properties.Header;
import org.gcube.informationsystem.types.annotations.Abstract;
2019-10-24 11:26:49 +02:00
import org.gcube.informationsystem.types.annotations.ISProperty;
import org.gcube.informationsystem.types.reference.Change;
import org.gcube.informationsystem.types.reference.TypeMetadata;
import org.gcube.informationsystem.utils.TypeVersion;
2019-10-24 11:26:49 +02:00
@Abstract
//@JsonDeserialize(as=RelationElementImpl.class) Do not uncomment to manage subclasses
@TypeMetadata(name = RelationElement.NAME, description = "This is the base class for any RelationElement", version = TypeVersion.MINIMAL_VERSION_STRING)
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
2020-02-03 10:51:29 +01:00
public interface RelationElement<S extends EntityElement, T extends EntityElement> extends Element, IdentifiableElement {
public static final String NAME = "RelationElement"; // RelationElement.class.getSimpleName();
2019-10-24 11:26:49 +02:00
public static final String SOURCE_PROPERTY = "source";
public static final String TARGET_PROPERTY = "target";
/* Overriding getHeader method to create Header property in type */
@ISProperty(name = HEADER_PROPERTY, mandatory = true, nullable = false)
@Override
public Header getHeader();
@JsonGetter(value=SOURCE_PROPERTY)
2019-11-04 18:06:46 +01:00
public S getSource();
2019-10-24 11:26:49 +02:00
@JsonIgnore
2019-11-04 18:06:46 +01:00
public void setSource(S source);
2019-10-24 11:26:49 +02:00
@JsonGetter(value=TARGET_PROPERTY)
2019-11-04 18:06:46 +01:00
public T getTarget();
2019-10-24 11:26:49 +02:00
@JsonIgnore
2019-11-04 18:06:46 +01:00
public void setTarget(T target);
2019-10-24 11:26:49 +02:00
}