2020-02-03 10:51:29 +01:00
|
|
|
package org.gcube.informationsystem.types.reference;
|
|
|
|
|
2020-12-11 17:28:56 +01:00
|
|
|
import java.util.Map;
|
2020-02-03 10:51:29 +01:00
|
|
|
import java.util.Set;
|
2023-04-19 16:38:40 +02:00
|
|
|
import java.util.UUID;
|
2020-02-03 10:51:29 +01:00
|
|
|
|
2021-01-07 11:16:40 +01:00
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonGetter;
|
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
2020-07-07 17:04:25 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
2023-04-19 16:38:40 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonSetter;
|
2021-02-11 17:24:22 +01:00
|
|
|
import org.gcube.informationsystem.base.reference.AccessType;
|
2020-02-03 10:51:29 +01:00
|
|
|
import org.gcube.informationsystem.base.reference.IdentifiableElement;
|
2023-04-19 16:38:40 +02:00
|
|
|
import org.gcube.informationsystem.model.reference.properties.Metadata;
|
2020-02-03 10:51:29 +01:00
|
|
|
import org.gcube.informationsystem.types.annotations.Abstract;
|
2020-02-03 10:57:41 +01:00
|
|
|
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
2021-10-21 10:11:45 +02:00
|
|
|
import org.gcube.informationsystem.utils.Version;
|
2020-02-03 10:51:29 +01:00
|
|
|
|
2021-01-20 17:03:02 +01:00
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
|
|
*/
|
2020-02-03 10:51:29 +01:00
|
|
|
@Abstract
|
|
|
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
2023-04-26 21:39:57 +02:00
|
|
|
@TypeMetadata(name = Type.NAME, description = "This is the base type to define any Type", 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
|
|
|
//@JsonDeserialize(as=TypeImpl.class) Do not uncomment to manage subclasses
|
2020-02-03 10:57:41 +01:00
|
|
|
public interface Type extends IdentifiableElement {
|
2020-02-03 10:51:29 +01:00
|
|
|
|
|
|
|
public static final String NAME = "Type"; //Type.class.getSimpleName();
|
|
|
|
|
|
|
|
public static final String NAME_PROPERTY = "name";
|
|
|
|
public static final String DESCRIPTION_PROPERTY = "description";
|
2020-12-11 09:47:14 +01:00
|
|
|
public static final String VERSION_PROPERTY = "version";
|
2020-12-11 17:28:56 +01:00
|
|
|
public static final String CHANGELOG_PROPERTY = "changelog";
|
2020-02-03 10:51:29 +01:00
|
|
|
public static final String ABSTRACT_PROPERTY = "abstract";
|
2023-01-24 19:52:18 +01:00
|
|
|
public static final String FINAL_PROPERTY = "final";
|
2023-04-27 11:17:08 +02:00
|
|
|
/* Cannot use 'supertypes' which conflicts with Element */
|
2023-04-27 11:14:35 +02:00
|
|
|
public static final String TYPE_SUPER_TYPES_PROPERTY = "typeSuperTypes";
|
2020-02-03 10:57:41 +01:00
|
|
|
public static final String PROPERTIES_PROPERTY = "properties";
|
2020-02-03 10:51:29 +01:00
|
|
|
|
2023-04-28 11:33:29 +02:00
|
|
|
@JsonGetter(value = ID_PROPERTY)
|
2023-04-19 16:38:40 +02:00
|
|
|
@Override
|
2023-04-28 11:33:29 +02:00
|
|
|
public UUID getID();
|
2023-04-19 16:38:40 +02:00
|
|
|
|
2023-04-28 11:33:29 +02:00
|
|
|
@JsonSetter(value = ID_PROPERTY)
|
2023-04-19 16:38:40 +02:00
|
|
|
@Override
|
2023-04-28 11:33:29 +02:00
|
|
|
public void setID(UUID uuid);
|
2023-04-19 16:38:40 +02:00
|
|
|
|
|
|
|
@JsonGetter(value = METADATA_PROPERTY)
|
|
|
|
@Override
|
|
|
|
public Metadata getMetadata();
|
|
|
|
|
|
|
|
@JsonSetter(value = METADATA_PROPERTY)
|
|
|
|
@Override
|
|
|
|
public void setMetadata(Metadata metadata);
|
|
|
|
|
2020-02-03 10:51:29 +01:00
|
|
|
public String getName();
|
|
|
|
|
|
|
|
public String getDescription();
|
2020-12-11 13:09:02 +01:00
|
|
|
|
2021-01-07 11:16:40 +01:00
|
|
|
@JsonIgnore
|
2021-10-21 10:11:45 +02:00
|
|
|
public Version getVersion();
|
2020-12-11 09:47:14 +01:00
|
|
|
|
2021-01-07 11:16:40 +01:00
|
|
|
@JsonGetter(value = VERSION_PROPERTY)
|
|
|
|
public String getVersionAsString();
|
|
|
|
|
|
|
|
@JsonIgnore
|
2021-10-21 10:11:45 +02:00
|
|
|
public Map<Version, String> getChangelog();
|
2020-12-11 17:28:56 +01:00
|
|
|
|
2021-01-07 11:16:40 +01:00
|
|
|
@JsonGetter(value = CHANGELOG_PROPERTY)
|
2021-01-15 17:57:06 +01:00
|
|
|
public Map<String, String> getChangelogWithVersionAsString();
|
2021-01-07 11:16:40 +01:00
|
|
|
|
2023-01-24 19:52:18 +01:00
|
|
|
@JsonGetter(value = ABSTRACT_PROPERTY)
|
2020-02-03 10:51:29 +01:00
|
|
|
public boolean isAbstract();
|
|
|
|
|
2023-01-24 19:52:18 +01:00
|
|
|
@JsonGetter(value = FINAL_PROPERTY)
|
|
|
|
public boolean isFinal();
|
|
|
|
|
2023-04-27 11:14:35 +02:00
|
|
|
@JsonGetter(value = TYPE_SUPER_TYPES_PROPERTY)
|
|
|
|
public Set<String> getTypeSuperTypes();
|
2020-02-03 10:51:29 +01:00
|
|
|
|
2020-02-03 10:57:41 +01:00
|
|
|
public Set<PropertyDefinition> getProperties();
|
2021-02-11 17:24:22 +01:00
|
|
|
|
2021-06-29 17:34:54 +02:00
|
|
|
@JsonIgnore
|
2021-02-11 22:09:02 +01:00
|
|
|
public AccessType getAccessType();
|
2020-02-03 10:57:41 +01:00
|
|
|
|
2020-02-03 10:51:29 +01:00
|
|
|
}
|