2019-10-23 16:55:48 +02:00
package org.gcube.informationsystem.base.reference.relations ;
2023-04-18 17:51:23 +02:00
import java.util.UUID ;
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 ;
2020-01-30 10:26:43 +01:00
import org.gcube.informationsystem.base.reference.entities.EntityElement ;
2023-04-18 17:51:23 +02:00
import org.gcube.informationsystem.model.reference.properties.Metadata ;
2019-10-23 16:55:48 +02:00
import org.gcube.informationsystem.types.annotations.Abstract ;
2019-10-24 11:26:49 +02:00
import org.gcube.informationsystem.types.annotations.ISProperty ;
2020-12-15 11:28:34 +01:00
import org.gcube.informationsystem.types.reference.Change ;
import org.gcube.informationsystem.types.reference.TypeMetadata ;
2021-10-21 10:11:45 +02:00
import org.gcube.informationsystem.utils.Version ;
2019-10-24 11:26:49 +02:00
2021-01-20 17:03:02 +01:00
/ * *
* @author Luca Frosini ( ISTI - CNR )
* /
2019-10-23 16:55:48 +02:00
@Abstract
2020-01-30 10:26:43 +01:00
//@JsonDeserialize(as=RelationElementImpl.class) Do not uncomment to manage subclasses
2023-04-26 21:39:57 +02:00
@TypeMetadata ( name = RelationElement . NAME , description = " This is the base type for any RelationElement " , version = Version . MINIMAL_VERSION_STRING )
2021-10-21 10:11:45 +02:00
@Change ( version = Version . MINIMAL_VERSION_STRING , description = Version . MINIMAL_VERSION_DESCRIPTION )
2020-02-03 10:51:29 +01:00
public interface RelationElement < S extends EntityElement , T extends EntityElement > extends Element , IdentifiableElement {
2019-10-23 16:55:48 +02:00
2020-01-30 10:26:43 +01:00
public static final String NAME = " RelationElement " ; // RelationElement.class.getSimpleName();
2019-10-23 16:55:48 +02:00
2023-04-20 10:27:01 +02:00
public static final String SOURCE_PROPERTY = " source " ;
public static final String TARGET_PROPERTY = " target " ;
2023-04-18 17:51:23 +02:00
@ISProperty ( name = UUID_PROPERTY , description = " This UUID is be used to identify the instance univocally. " , readonly = true , mandatory = true , nullable = false )
@Override
public UUID getUUID ( ) ;
@Override
public void setUUID ( UUID uuid ) ;
2019-10-24 11:26:49 +02:00
2023-04-19 16:38:40 +02:00
@ISProperty ( name = METADATA_PROPERTY , mandatory = true , nullable = false , description = " Metadata associated with the instance that is automatically created/updated by the system. " )
@Override
public Metadata getMetadata ( ) ;
@Override
public void setMetadata ( Metadata metadata ) ;
2019-10-24 11:26:49 +02:00
@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
2019-10-23 16:55:48 +02:00
}