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

38 lines
1.3 KiB
Java
Raw Normal View History

package org.gcube.informationsystem.base.reference.relations;
2019-10-24 11:26:49 +02:00
import org.gcube.informationsystem.base.reference.ER;
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 com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Abstract
//@JsonDeserialize(as=RelationElementImpl.class) Do not uncomment to manage subclasses
public interface RelationElement<S extends EntityElement, T extends EntityElement> extends ER {
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
}