diff --git a/CHANGELOG.md b/CHANGELOG.md index e449681..2a29aa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm # Changelog for Information System Model +## [v4.2.0] + +- Added version information on Type ## [v4.1.0] diff --git a/pom.xml b/pom.xml index 8be67e8..7ed0266 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.gcube.information-system information-system-model - 4.1.0 + 4.2.0-SNAPSHOT Information System Model Information System Model is the reference model of the gCube Information System jar diff --git a/src/main/java/org/gcube/informationsystem/types/impl/TypeImpl.java b/src/main/java/org/gcube/informationsystem/types/impl/TypeImpl.java index cb5a824..e1b5e57 100644 --- a/src/main/java/org/gcube/informationsystem/types/impl/TypeImpl.java +++ b/src/main/java/org/gcube/informationsystem/types/impl/TypeImpl.java @@ -36,11 +36,13 @@ public class TypeImpl implements Type { private static final long serialVersionUID = -4333954207969059451L; public final static String DESCRIPTION = "DESCRIPTION"; + public final static String VERSION = "VERSION"; protected Header header; protected String name; protected String description; + protected String version; @JsonProperty(value="abstract") protected boolean abstractType; protected Set superClasses; @@ -133,6 +135,7 @@ public class TypeImpl implements Type { protected TypeImpl(Class clz) { this.name = TypeMapper.getType(clz); this.description = TypeMapper.getStaticStringFieldByName(clz, DESCRIPTION, ""); + this.version = TypeMapper.getStaticStringFieldByName(clz, VERSION, "1.0.0"); this.abstractType = false; if(clz.isAnnotationPresent(Abstract.class)){ @@ -161,6 +164,11 @@ public class TypeImpl implements Type { public String getDescription() { return description; } + + @Override + public String getVersion() { + return version; + } @Override public boolean isAbstract() { @@ -176,4 +184,5 @@ public class TypeImpl implements Type { public Set getProperties() { return properties; } + } diff --git a/src/main/java/org/gcube/informationsystem/types/reference/Type.java b/src/main/java/org/gcube/informationsystem/types/reference/Type.java index 6b8c087..b371637 100644 --- a/src/main/java/org/gcube/informationsystem/types/reference/Type.java +++ b/src/main/java/org/gcube/informationsystem/types/reference/Type.java @@ -16,6 +16,7 @@ public interface Type extends IdentifiableElement { public static final String NAME_PROPERTY = "name"; public static final String DESCRIPTION_PROPERTY = "description"; + public static final String VERSION_PROPERTY = "version"; public static final String ABSTRACT_PROPERTY = "abstract"; public static final String TYPE_SUPERCLASSES_PROPERTY = "superClasses"; public static final String PROPERTIES_PROPERTY = "properties"; @@ -24,6 +25,8 @@ public interface Type extends IdentifiableElement { public String getDescription(); + public String getVersion(); + public boolean isAbstract(); public Set getSuperClasses();