Renamed TypeVersion class to Version
This commit is contained in:
parent
05b6b65fee
commit
66fead0851
|
@ -9,7 +9,7 @@ import org.gcube.com.fasterxml.jackson.annotation.JsonTypeInfo;
|
|||
import org.gcube.informationsystem.types.annotations.Abstract;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
|
@ -17,8 +17,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
@Abstract
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = Element.CLASS_PROPERTY)
|
||||
// @JsonTypeIdResolver(ElementTypeIdResolver.class)
|
||||
@TypeMetadata(name = Element.NAME, description = "This is the base class for Element", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Element.NAME, description = "This is the base class for Element", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface Element extends Serializable {
|
||||
|
||||
public static final String NAME = "Element"; //Element.class.getSimpleName();
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.gcube.informationsystem.types.annotations.Abstract;
|
|||
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;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
|
@ -16,8 +16,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
@Abstract
|
||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||
//@JsonDeserialize(as=EntityElementImpl.class) Do not uncomment to manage subclasses
|
||||
@TypeMetadata(name = EntityElement.NAME, description = "This is the base class for any EntityElement", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = EntityElement.NAME, description = "This is the base class for any EntityElement", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface EntityElement extends Element, IdentifiableElement {
|
||||
|
||||
public static final String NAME = "EntityElement"; //Entity.class.getSimpleName();
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.gcube.informationsystem.base.impl.properties.PropertyElementImpl;
|
|||
import org.gcube.informationsystem.base.reference.Element;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* Root Class for Property types.
|
||||
|
@ -14,8 +14,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as=PropertyElementImpl.class)
|
||||
@TypeMetadata(name = PropertyElement.NAME, description = "This is the base class for any PropertyElement", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = PropertyElement.NAME, description = "This is the base class for any PropertyElement", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface PropertyElement extends Element {
|
||||
|
||||
public static final String NAME = "PropertyElement"; //PropertyElement.class.getSimpleName();
|
||||
|
|
|
@ -10,15 +10,15 @@ import org.gcube.informationsystem.types.annotations.Abstract;
|
|||
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;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@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)
|
||||
@TypeMetadata(name = RelationElement.NAME, description = "This is the base class for any RelationElement", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface RelationElement<S extends EntityElement, T extends EntityElement> extends Element, IdentifiableElement {
|
||||
|
||||
public static final String NAME = "RelationElement"; // RelationElement.class.getSimpleName();
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.gcube.informationsystem.model.reference.relations.Relation;
|
|||
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;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Context
|
||||
|
@ -25,8 +25,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as = ContextImpl.class)
|
||||
@TypeMetadata(name = Context.NAME, description = "This class is the used to define a Context", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Context.NAME, description = "This class is the used to define a Context", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface Context extends EntityElement {
|
||||
|
||||
public static final String NAME = "Context"; // Context.class.getSimpleName();
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.gcube.informationsystem.context.impl.relations.IsParentOfImpl;
|
|||
import org.gcube.informationsystem.context.reference.entities.Context;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#IsParentOf
|
||||
|
@ -20,8 +20,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as = IsParentOfImpl.class)
|
||||
@TypeMetadata(name = IsParentOf.NAME, description = "This class is the used to define parental relations between Context", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = IsParentOf.NAME, description = "This class is the used to define parental relations between Context", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface IsParentOf extends RelationElement<Context,Context> {
|
||||
|
||||
public static final String NAME = "IsParentOf"; //IsParentOf.class.getSimpleName();
|
||||
|
|
|
@ -9,13 +9,13 @@ import org.gcube.informationsystem.model.impl.properties.HeaderImpl;
|
|||
import org.gcube.informationsystem.model.reference.entities.Facet;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@TypeMetadata(name = Facet.NAME, description = "This is a dummy class for Facet", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Facet.NAME, description = "This is a dummy class for Facet", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public class DummyFacet extends FacetImpl implements Facet {
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,13 +9,13 @@ import org.gcube.informationsystem.model.impl.properties.HeaderImpl;
|
|||
import org.gcube.informationsystem.model.reference.entities.Resource;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@TypeMetadata(name = Resource.NAME, description = "This is a dummy class for Resource", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Resource.NAME, description = "This is a dummy class for Resource", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public class DummyResource extends ResourceImpl implements Resource {
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,13 +8,13 @@ import org.gcube.informationsystem.model.reference.properties.PropagationConstra
|
|||
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@TypeMetadata(name = IsRelatedTo.NAME, description = "This is a dummy class for IsRelatedTo", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = IsRelatedTo.NAME, description = "This is a dummy class for IsRelatedTo", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public class DummyIsRelatedTo<S extends Resource, T extends Resource>
|
||||
extends IsRelatedToImpl<S, T> implements IsRelatedTo<S, T>{
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.gcube.informationsystem.model.reference.ERElement;
|
|||
import org.gcube.informationsystem.types.annotations.Abstract;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Entity
|
||||
|
@ -17,8 +17,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
*/
|
||||
@Abstract
|
||||
//@JsonDeserialize(as=EntityImpl.class) Do not uncomment to manage subclasses
|
||||
@TypeMetadata(name = Entity.NAME, description = "This is the base class for Entities", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Entity.NAME, description = "This is the base class for Entities", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface Entity extends EntityElement, ERElement {
|
||||
|
||||
public static final String NAME = "Entity"; //Entity.class.getSimpleName();
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.gcube.informationsystem.types.annotations.Abstract;
|
|||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.AdditionalPropertiesSerializer;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
|
@ -19,8 +19,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
*/
|
||||
@Abstract
|
||||
// @JsonDeserialize(as=FacetImpl.class) Do not uncomment to manage subclasses
|
||||
@TypeMetadata(name = "Facet", description = "This is the base class for Facets", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = "Facet", description = "This is the base class for Facets", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface Facet extends Entity, SchemaMixedElement {
|
||||
|
||||
public static final String NAME = "Facet"; //Facet.class.getSimpleName();
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.gcube.informationsystem.types.annotations.ResourceSchemaEntry;
|
|||
import org.gcube.informationsystem.types.annotations.RelatedResourcesEntry;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Resource
|
||||
|
@ -34,8 +34,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
@RelatedResourcesEntry(source=Resource.class, relation=IsRelatedTo.class, target=Resource.class, description="Any Resource can be related to any other resource.")
|
||||
}
|
||||
)
|
||||
@TypeMetadata(name = Resource.NAME, description = "This is the base class for Resources", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Resource.NAME, description = "This is the base class for Resources", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface Resource extends Entity {
|
||||
|
||||
public static final String NAME = "Resource"; //Resource.class.getSimpleName();
|
||||
|
|
|
@ -7,14 +7,14 @@ import org.gcube.informationsystem.model.impl.properties.EncryptedImpl;
|
|||
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;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as=EncryptedImpl.class)
|
||||
@TypeMetadata(name = Encrypted.NAME, description = "This is the base class for Encrypted values", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Encrypted.NAME, description = "This is the base class for Encrypted values", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface Encrypted extends Property {
|
||||
|
||||
public static final String NAME = "Encrypted"; // Encrypted.class.getSimpleName();
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.gcube.informationsystem.model.impl.properties.HeaderImpl;
|
|||
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;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Header
|
||||
|
@ -21,8 +21,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as=HeaderImpl.class)
|
||||
@TypeMetadata(name = Header.NAME, description = "This class provides metadata per every IdentifiableElement", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Header.NAME, description = "This class provides metadata per every IdentifiableElement", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface Header extends Property {
|
||||
|
||||
public static final String NAME = "Header"; // Header.class.getSimpleName();
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.gcube.informationsystem.model.impl.properties.PropagationConstraintIm
|
|||
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;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* At any time entities and relations can be added or removed to/from a context or deleted.
|
||||
|
@ -25,8 +25,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as=PropagationConstraintImpl.class)
|
||||
@TypeMetadata(name = PropagationConstraint.NAME, description = "This class provides propation constraint for Relation", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = PropagationConstraint.NAME, description = "This class provides propation constraint for Relation", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface PropagationConstraint extends Property {
|
||||
|
||||
public static final String NAME = "PropagationConstraint"; // PropagationConstraint.class.getSimpleName();
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.gcube.informationsystem.model.impl.properties.PropertyImpl;
|
|||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.AdditionalPropertiesSerializer;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* Root Class for Property types.
|
||||
|
@ -25,8 +25,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
*/
|
||||
// @JsonIgnoreProperties(ignoreUnknown=true)
|
||||
@JsonDeserialize(as=PropertyImpl.class)
|
||||
@TypeMetadata(name = Property.NAME, description = "This is the base class for Properties", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Property.NAME, description = "This is the base class for Properties", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface Property extends PropertyElement, SchemaMixedElement {
|
||||
|
||||
public static final String NAME = "Property"; //Property.class.getSimpleName();
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.gcube.informationsystem.model.reference.entities.Facet;
|
|||
import org.gcube.informationsystem.model.reference.entities.Resource;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#ConsistsOf
|
||||
|
@ -17,8 +17,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as=ConsistsOfImpl.class)
|
||||
@TypeMetadata(name = ConsistsOf.NAME, description = "This is the base class for ConsistsOf relations", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = ConsistsOf.NAME, description = "This is the base class for ConsistsOf relations", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface ConsistsOf<S extends Resource, T extends Facet>
|
||||
extends Relation<S, T> {
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.gcube.informationsystem.model.reference.entities.Resource;
|
|||
import org.gcube.informationsystem.types.annotations.Abstract;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
|
@ -16,8 +16,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
*/
|
||||
@Abstract
|
||||
// @JsonDeserialize(as=IsRelatedToImpl.class) Do not uncomment to manage subclasses
|
||||
@TypeMetadata(name = IsRelatedTo.NAME, description = "This is the base class for IsRelatedTo relations", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = IsRelatedTo.NAME, description = "This is the base class for IsRelatedTo relations", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface IsRelatedTo<S extends Resource, T extends Resource>
|
||||
extends Relation<S, T> {
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ 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.AdditionalPropertiesSerializer;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
|
@ -31,8 +31,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
*/
|
||||
@Abstract
|
||||
// @JsonDeserialize(as=RelationImpl.class) Do not uncomment to manage subclasses
|
||||
@TypeMetadata(name = Relation.NAME, description = "This is the base class for Relations", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Relation.NAME, description = "This is the base class for Relations", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface Relation<S extends Resource, T extends Entity> extends RelationElement<S,T>, SchemaMixedElement, ERElement {
|
||||
|
||||
public static final String NAME = "Relation"; //Relation.class.getSimpleName();
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.gcube.informationsystem.model.reference.properties.Header;
|
|||
import org.gcube.informationsystem.querytemplates.reference.entities.QueryTemplate;
|
||||
import org.gcube.informationsystem.querytemplates.reference.properties.TemplateProperty;
|
||||
import org.gcube.informationsystem.querytemplates.reference.properties.TemplateVariable;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
|
@ -28,10 +28,10 @@ public class QueryTemplatesImpl implements QueryTemplate {
|
|||
|
||||
protected String name;
|
||||
protected String description;
|
||||
protected TypeVersion version;
|
||||
protected Version version;
|
||||
@JsonProperty(value = CHANGELOG_PROPERTY, required = true)
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
protected Map<TypeVersion, String> changelog;
|
||||
protected Map<Version, String> changelog;
|
||||
|
||||
protected TemplateProperty templateProperty;
|
||||
protected Set<TemplateVariable> templateDefaultValues;
|
||||
|
@ -72,12 +72,12 @@ public class QueryTemplatesImpl implements QueryTemplate {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TypeVersion getVersion() {
|
||||
public Version getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVersion(TypeVersion typeVersion) {
|
||||
public void setVersion(Version typeVersion) {
|
||||
this.version = typeVersion;
|
||||
}
|
||||
|
||||
|
@ -88,16 +88,16 @@ public class QueryTemplatesImpl implements QueryTemplate {
|
|||
|
||||
@Override
|
||||
public void setVersion(String version) {
|
||||
this.version = new TypeVersion(version);
|
||||
this.version = new Version(version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<TypeVersion, String> getChangelog() {
|
||||
public Map<Version, String> getChangelog() {
|
||||
return changelog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChangelog(TypeVersion typeVersion, String changeDescription) {
|
||||
public void addChangelog(Version typeVersion, String changeDescription) {
|
||||
if(changelog.get(typeVersion)!=null) {
|
||||
throw new RuntimeException("Changelog for version " + typeVersion.toString() + " alread exists");
|
||||
}
|
||||
|
@ -107,14 +107,14 @@ public class QueryTemplatesImpl implements QueryTemplate {
|
|||
@Override
|
||||
public Map<String, String> getChangelogWithVersionAsString() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
for (TypeVersion typeVersion : changelog.keySet()) {
|
||||
for (Version typeVersion : changelog.keySet()) {
|
||||
map.put(typeVersion.toString(), changelog.get(typeVersion));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChangelog(Map<TypeVersion, String> changelog) {
|
||||
public void setChangelog(Map<Version, String> changelog) {
|
||||
this.changelog = changelog;
|
||||
}
|
||||
|
||||
|
@ -122,13 +122,13 @@ public class QueryTemplatesImpl implements QueryTemplate {
|
|||
public void setChangelogWithVersionAsString(Map<String, String> changelog) {
|
||||
this.changelog = new HashMap<>();
|
||||
for (String version : changelog.keySet()) {
|
||||
this.changelog.put(new TypeVersion(version), changelog.get(version));
|
||||
this.changelog.put(new Version(version), changelog.get(version));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addChangelog(String version, String changeDescription) {
|
||||
TypeVersion typeVersion = new TypeVersion(version);
|
||||
Version typeVersion = new Version(version);
|
||||
addChangelog(typeVersion, changeDescription);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.gcube.informationsystem.types.annotations.Abstract;
|
|||
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;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
|
@ -26,8 +26,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
@Abstract
|
||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||
@JsonDeserialize(as=QueryTemplatesImpl.class)
|
||||
@TypeMetadata(name = QueryTemplate.NAME, description = "The type used to store Query Templates", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = QueryTemplate.NAME, description = "The type used to store Query Templates", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface QueryTemplate extends IdentifiableElement {
|
||||
|
||||
public static final String NAME = "QueryTemplates"; //QueryTemplates.class.getSimpleName();
|
||||
|
@ -51,9 +51,9 @@ public interface QueryTemplate extends IdentifiableElement {
|
|||
public void setDescription(String description);
|
||||
|
||||
@JsonIgnore
|
||||
public TypeVersion getVersion();
|
||||
public Version getVersion();
|
||||
|
||||
public void setVersion(TypeVersion typeVersion);
|
||||
public void setVersion(Version typeVersion);
|
||||
|
||||
@JsonGetter(value = VERSION_PROPERTY)
|
||||
@ISProperty(name = VERSION_PROPERTY, description = "The version of the Query Template.", readonly = false, mandatory = true, nullable = false)
|
||||
|
@ -63,13 +63,13 @@ public interface QueryTemplate extends IdentifiableElement {
|
|||
public void setVersion(String version);
|
||||
|
||||
@JsonIgnore
|
||||
public Map<TypeVersion, String> getChangelog();
|
||||
public Map<Version, String> getChangelog();
|
||||
|
||||
@JsonIgnore
|
||||
public void setChangelog(Map<TypeVersion, String> changelog);
|
||||
public void setChangelog(Map<Version, String> changelog);
|
||||
|
||||
@JsonIgnore
|
||||
public void addChangelog(TypeVersion typeVersion, String changeDescription);
|
||||
public void addChangelog(Version typeVersion, String changeDescription);
|
||||
|
||||
@JsonGetter(value = CHANGELOG_PROPERTY)
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
|
|
|
@ -5,14 +5,14 @@ import org.gcube.informationsystem.base.reference.properties.PropertyElement;
|
|||
import org.gcube.informationsystem.querytemplates.impl.properties.TemplatePropertyImpl;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as=TemplatePropertyImpl.class)
|
||||
@TypeMetadata(name = TemplateProperty.NAME, description = "This is the class used to define the TemplateProperty", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = TemplateProperty.NAME, description = "This is the class used to define the TemplateProperty", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface TemplateProperty extends PropertyElement {
|
||||
|
||||
public static final String NAME = "TemplateProperty"; // TemplateProperty.class.getSimpleName();
|
||||
|
|
|
@ -6,14 +6,14 @@ import org.gcube.informationsystem.querytemplates.impl.properties.TemplateProper
|
|||
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;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as=TemplatePropertyImpl.class)
|
||||
@TypeMetadata(name = TemplateVariable.NAME, description = "This is the class used to define the a TemplateVariable", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = TemplateVariable.NAME, description = "This is the class used to define the a TemplateVariable", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface TemplateVariable extends PropertyElement {
|
||||
|
||||
public static final String NAME = "TemplateVariable"; // TemplateVariable.class.getSimpleName();
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.util.UUID;
|
|||
|
||||
import org.gcube.informationsystem.base.reference.Element;
|
||||
import org.gcube.informationsystem.base.reference.properties.PropertyElement;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -144,7 +144,7 @@ public class PropertyTypeName {
|
|||
BASE_PROPERTY_TYPES_BY_CLASS.put(URI.class, BaseType.STRING);
|
||||
BASE_PROPERTY_TYPES_BY_CLASS.put(URL.class, BaseType.STRING);
|
||||
BASE_PROPERTY_TYPES_BY_CLASS.put(UUID.class, BaseType.STRING);
|
||||
BASE_PROPERTY_TYPES_BY_CLASS.put(TypeVersion.class, BaseType.STRING);
|
||||
BASE_PROPERTY_TYPES_BY_CLASS.put(Version.class, BaseType.STRING);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.gcube.informationsystem.types.reference.properties.PropertyType;
|
|||
import org.gcube.informationsystem.types.reference.relations.ConsistsOfType;
|
||||
import org.gcube.informationsystem.types.reference.relations.IsRelatedToType;
|
||||
import org.gcube.informationsystem.types.reference.relations.RelationType;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
|
@ -144,25 +144,25 @@ public class TypeMapper {
|
|||
}
|
||||
}
|
||||
|
||||
public static TypeVersion getTypeVersion(Class<? extends Element> clz){
|
||||
public static Version getTypeVersion(Class<? extends Element> clz){
|
||||
String classSimpleName = clz.getSimpleName();
|
||||
if(clz.isAnnotationPresent(TypeMetadata.class)) {
|
||||
TypeMetadata typeMetadata = clz.getAnnotation(TypeMetadata.class);
|
||||
return new TypeVersion(typeMetadata.version());
|
||||
return new Version(typeMetadata.version());
|
||||
}else {
|
||||
throw new RuntimeException("You must provide @TypeMetadata for " + classSimpleName);
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<TypeVersion, String> getTypeChangelog(Class<? extends Element> clz){
|
||||
Map<TypeVersion, String> map = new HashMap<>();
|
||||
public static Map<Version, String> getTypeChangelog(Class<? extends Element> clz){
|
||||
Map<Version, String> map = new HashMap<>();
|
||||
|
||||
if(clz.isAnnotationPresent(Changelog.class)) {
|
||||
Changelog changelog = clz.getAnnotation(Changelog.class);
|
||||
Change[] changes = changelog.value();
|
||||
for(Change change : changes) {
|
||||
String version = change.version();
|
||||
TypeVersion typeVersion = new TypeVersion(version);
|
||||
Version typeVersion = new Version(version);
|
||||
if(map.containsKey(typeVersion)) {
|
||||
throw new RuntimeException("Duplicated version " + version +" in @Change annotation");
|
||||
}
|
||||
|
@ -176,11 +176,11 @@ public class TypeMapper {
|
|||
}
|
||||
}
|
||||
|
||||
if(!map.containsKey(TypeVersion.MINIMAL_VERSION)) {
|
||||
if(!map.containsKey(Version.MINIMAL_VERSION)) {
|
||||
map.putAll(TypeImpl.DEFAULT_CHANGELOG_MAP);
|
||||
}
|
||||
|
||||
TypeVersion typeVersion = getTypeVersion(clz);
|
||||
Version typeVersion = getTypeVersion(clz);
|
||||
if (!map.containsKey(typeVersion)) {
|
||||
throw new RuntimeException("The Type " + clz.getSimpleName() + " does not provided the appropriated changelog Map");
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.gcube.informationsystem.types.impl.properties.PropertyTypeImpl;
|
|||
import org.gcube.informationsystem.types.impl.relations.RelationTypeImpl;
|
||||
import org.gcube.informationsystem.types.reference.Type;
|
||||
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -51,14 +51,14 @@ public class TypeImpl implements Type {
|
|||
public final static String CHANGELOG = "CHANGELOG";
|
||||
*/
|
||||
|
||||
public static final Map<TypeVersion, String> DEFAULT_CHANGELOG_MAP;
|
||||
public static final Map<Version, String> DEFAULT_CHANGELOG_MAP;
|
||||
private static final Map<String, String> DEFAULT_CHANGELOG_MAP_KEY_AS_STRING;
|
||||
|
||||
static {
|
||||
DEFAULT_CHANGELOG_MAP = new HashMap<>();
|
||||
DEFAULT_CHANGELOG_MAP.put(new TypeVersion(TypeVersion.MINIMAL_VERSION_STRING), TypeVersion.MINIMAL_VERSION_DESCRIPTION);
|
||||
DEFAULT_CHANGELOG_MAP.put(new Version(Version.MINIMAL_VERSION_STRING), Version.MINIMAL_VERSION_DESCRIPTION);
|
||||
DEFAULT_CHANGELOG_MAP_KEY_AS_STRING = new HashMap<>();
|
||||
DEFAULT_CHANGELOG_MAP_KEY_AS_STRING.put(TypeVersion.MINIMAL_VERSION_STRING, TypeVersion.MINIMAL_VERSION_DESCRIPTION);
|
||||
DEFAULT_CHANGELOG_MAP_KEY_AS_STRING.put(Version.MINIMAL_VERSION_STRING, Version.MINIMAL_VERSION_DESCRIPTION);
|
||||
}
|
||||
|
||||
|
||||
|
@ -66,10 +66,10 @@ public class TypeImpl implements Type {
|
|||
|
||||
protected String name;
|
||||
protected String description;
|
||||
protected TypeVersion version;
|
||||
protected Version version;
|
||||
@JsonProperty(value = CHANGELOG_PROPERTY, required = false)
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
protected Map<TypeVersion, String> changelog;
|
||||
protected Map<Version, String> changelog;
|
||||
|
||||
@JsonProperty(value = "abstract")
|
||||
protected boolean abstractType;
|
||||
|
@ -204,7 +204,7 @@ public class TypeImpl implements Type {
|
|||
}
|
||||
|
||||
@Override
|
||||
public TypeVersion getVersion() {
|
||||
public Version getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
|
@ -215,11 +215,11 @@ public class TypeImpl implements Type {
|
|||
|
||||
@JsonSetter(value = VERSION_PROPERTY)
|
||||
public void setVersion(String version) {
|
||||
this.version = new TypeVersion(version);
|
||||
this.version = new Version(version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<TypeVersion, String> getChangelog() {
|
||||
public Map<Version, String> getChangelog() {
|
||||
return changelog;
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ public class TypeImpl implements Type {
|
|||
return DEFAULT_CHANGELOG_MAP_KEY_AS_STRING;
|
||||
}
|
||||
Map<String, String> map = new HashMap<>();
|
||||
for (TypeVersion typeVersion : changelog.keySet()) {
|
||||
for (Version typeVersion : changelog.keySet()) {
|
||||
map.put(typeVersion.toString(), changelog.get(typeVersion));
|
||||
}
|
||||
return map;
|
||||
|
@ -244,7 +244,7 @@ public class TypeImpl implements Type {
|
|||
}
|
||||
this.changelog = new HashMap<>();
|
||||
for (String version : changelog.keySet()) {
|
||||
this.changelog.put(new TypeVersion(version), changelog.get(version));
|
||||
this.changelog.put(new Version(version), changelog.get(version));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
|
|||
import org.gcube.informationsystem.types.PropertyTypeName;
|
||||
import org.gcube.informationsystem.types.annotations.ISProperty;
|
||||
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -108,8 +108,8 @@ public final class PropertyDefinitionImpl implements PropertyDefinition {
|
|||
if(URL.class.isAssignableFrom(clz)){
|
||||
this.regexp = URL_REGEX;
|
||||
}
|
||||
if(TypeVersion.class.isAssignableFrom(clz)){
|
||||
this.regexp = TypeVersion.TYPE_VERSION_REGEX;
|
||||
if(Version.class.isAssignableFrom(clz)){
|
||||
this.regexp = Version.VERSION_REGEX;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,15 +10,15 @@ import org.gcube.informationsystem.base.reference.AccessType;
|
|||
import org.gcube.informationsystem.base.reference.IdentifiableElement;
|
||||
import org.gcube.informationsystem.types.annotations.Abstract;
|
||||
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@Abstract
|
||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||
@TypeMetadata(name = Type.NAME, description = "This is the base class to define any Type", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Type.NAME, description = "This is the base class to define any Type", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
//@JsonDeserialize(as=TypeImpl.class) Do not uncomment to manage subclasses
|
||||
public interface Type extends IdentifiableElement {
|
||||
|
||||
|
@ -37,13 +37,13 @@ public interface Type extends IdentifiableElement {
|
|||
public String getDescription();
|
||||
|
||||
@JsonIgnore
|
||||
public TypeVersion getVersion();
|
||||
public Version getVersion();
|
||||
|
||||
@JsonGetter(value = VERSION_PROPERTY)
|
||||
public String getVersionAsString();
|
||||
|
||||
@JsonIgnore
|
||||
public Map<TypeVersion, String> getChangelog();
|
||||
public Map<Version, String> getChangelog();
|
||||
|
||||
@JsonGetter(value = CHANGELOG_PROPERTY)
|
||||
public Map<String, String> getChangelogWithVersionAsString();
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.lang.annotation.Retention;
|
|||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
|
@ -21,6 +21,6 @@ public @interface TypeMetadata {
|
|||
|
||||
String description() default "";
|
||||
|
||||
String version() default TypeVersion.MINIMAL_VERSION_STRING;
|
||||
String version() default Version.MINIMAL_VERSION_STRING;
|
||||
|
||||
}
|
||||
|
|
|
@ -10,15 +10,15 @@ import org.gcube.informationsystem.types.impl.entities.EntityTypeImpl;
|
|||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.Type;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonDeserialize(as = EntityTypeImpl.class)
|
||||
@TypeMetadata(name = EntityType.NAME, description = "This class provides information for any EntityType", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = EntityType.NAME, description = "This class provides information for any EntityType", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface EntityType extends Type, EntityElement {
|
||||
|
||||
public static final String NAME = "EntityType"; //EntityType.class.getSimpleName();
|
||||
|
|
|
@ -10,15 +10,15 @@ import org.gcube.informationsystem.types.reference.Change;
|
|||
import org.gcube.informationsystem.types.reference.Type;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonDeserialize(as = FacetTypeImpl.class)
|
||||
@TypeMetadata(name = FacetType.NAME, description = "This class provides information for the definition of any FacetType", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = FacetType.NAME, description = "This class provides information for the definition of any FacetType", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface FacetType extends EntityType {
|
||||
|
||||
public static final String NAME = "FacetType"; //FacetType.class.getSimpleName();
|
||||
|
|
|
@ -8,14 +8,14 @@ import org.gcube.informationsystem.types.impl.entities.ResourceTypeImpl;
|
|||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.types.reference.properties.LinkedEntity;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as=ResourceTypeImpl.class)
|
||||
@TypeMetadata(name = ResourceType.NAME, description = "This class provides information for the definition of any ResourceType", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = ResourceType.NAME, description = "This class provides information for the definition of any ResourceType", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface ResourceType extends EntityType {
|
||||
|
||||
public static final String NAME = "ResourceType"; //ResourceType.class.getSimpleName();
|
||||
|
|
|
@ -7,15 +7,15 @@ import org.gcube.informationsystem.types.annotations.ISProperty;
|
|||
import org.gcube.informationsystem.types.impl.properties.PropertyDefinitionImpl;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonDeserialize(as = PropertyDefinitionImpl.class)
|
||||
@TypeMetadata(name = Changelog.NAME, description = "This class provides version information for any Type", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = Changelog.NAME, description = "This class provides version information for any Type", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface Changelog extends PropertyElement {
|
||||
|
||||
public static final String NAME = "Changelog";
|
||||
|
@ -24,7 +24,7 @@ public interface Changelog extends PropertyElement {
|
|||
public static final String CHANGE_PROPERTY = "changelog";
|
||||
|
||||
@ISProperty(name = VERSION_PROPERTY, readonly = true, mandatory = true, nullable = false, regexpr = "")
|
||||
public TypeVersion getVersion();
|
||||
public Version getVersion();
|
||||
|
||||
@ISProperty(name = CHANGE_PROPERTY, readonly = true, mandatory = true, nullable = false)
|
||||
public String getChange();
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.gcube.informationsystem.types.annotations.ISProperty;
|
|||
import org.gcube.informationsystem.types.impl.properties.LinkedEntityImpl;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* A convenient type to define a Resource in terms of:
|
||||
|
@ -16,8 +16,8 @@ import org.gcube.informationsystem.utils.TypeVersion;
|
|||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as=LinkedEntityImpl.class)
|
||||
@TypeMetadata(name = LinkedEntity.NAME, description = " A convenient type to define a Resource in terms of: mandatory/recommended ConsistsOf->Facets; uggested IsRelatedTo->Resource.", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = LinkedEntity.NAME, description = " A convenient type to define a Resource in terms of: mandatory/recommended ConsistsOf->Facets; uggested IsRelatedTo->Resource.", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface LinkedEntity extends PropertyElement {
|
||||
|
||||
public static final String NAME = "LinkedEntity"; // LinkedEntity.class.getSimpleName();
|
||||
|
|
|
@ -7,15 +7,15 @@ import org.gcube.informationsystem.types.annotations.ISProperty;
|
|||
import org.gcube.informationsystem.types.impl.properties.PropertyDefinitionImpl;
|
||||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonDeserialize(as = PropertyDefinitionImpl.class)
|
||||
@TypeMetadata(name = PropertyDefinition.NAME, description = "This class provides information for the definition of any properties", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = PropertyDefinition.NAME, description = "This class provides information for the definition of any properties", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface PropertyDefinition extends PropertyElement {
|
||||
|
||||
public static final String NAME = "PropertyDefinition"; // PropertyDefinition.class.getSimpleName();
|
||||
|
|
|
@ -12,15 +12,15 @@ import org.gcube.informationsystem.types.impl.properties.PropertyTypeImpl;
|
|||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.Type;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonDeserialize(as = PropertyTypeImpl.class)
|
||||
@TypeMetadata(name = PropertyType.NAME, description = "This class provides information for any PropertyType", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = PropertyType.NAME, description = "This class provides information for any PropertyType", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface PropertyType<P extends PropertyElement> extends PropertyElement, Type {
|
||||
|
||||
public static final String NAME = "PropertyType"; // PropertyTypeDefinition.class.getSimpleName();
|
||||
|
|
|
@ -6,14 +6,14 @@ import org.gcube.informationsystem.types.reference.Change;
|
|||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.types.reference.entities.FacetType;
|
||||
import org.gcube.informationsystem.types.reference.entities.ResourceType;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as = ConsistsOfTypeImpl.class)
|
||||
@TypeMetadata(name = ConsistsOfType.NAME, description = "This class provides information for any ConsistsOfType", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = ConsistsOfType.NAME, description = "This class provides information for any ConsistsOfType", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface ConsistsOfType extends RelationType<ResourceType, FacetType> {
|
||||
|
||||
public static final String NAME = "ConsistsOfType"; // ConsistsOfType.class.getSimpleName();
|
||||
|
|
|
@ -5,14 +5,14 @@ import org.gcube.informationsystem.types.impl.relations.IsRelatedToTypeImpl;
|
|||
import org.gcube.informationsystem.types.reference.Change;
|
||||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.types.reference.entities.ResourceType;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonDeserialize(as = IsRelatedToTypeImpl.class)
|
||||
@TypeMetadata(name = IsRelatedToType.NAME, description = "This class provides information for any IsRelatedToType", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = IsRelatedToType.NAME, description = "This class provides information for any IsRelatedToType", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface IsRelatedToType extends RelationType<ResourceType, ResourceType> {
|
||||
|
||||
public static final String NAME = "IsRelatedToType"; // IsRelatedToType.class.getSimpleName();
|
||||
|
|
|
@ -12,15 +12,15 @@ import org.gcube.informationsystem.types.reference.Type;
|
|||
import org.gcube.informationsystem.types.reference.TypeMetadata;
|
||||
import org.gcube.informationsystem.types.reference.entities.EntityType;
|
||||
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonDeserialize(as = RelationTypeImpl.class)
|
||||
@TypeMetadata(name = RelationType.NAME, description = "This class provides information for any RelationType", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = RelationType.NAME, description = "This class provides information for any RelationType", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface RelationType<S extends EntityType, T extends EntityType>
|
||||
extends Type, RelationElement<S,T> {
|
||||
|
||||
|
|
|
@ -7,20 +7,20 @@ import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
|||
/**
|
||||
* A class representing and validating a version in the following format X.X.X (Major.Minor.Revision)
|
||||
* Each part is an integer with no trailing zeros (e.g 1 and not 01).
|
||||
* The version is validated by the regex defined in the static field {@link TypeVersion#TYPE_VERSION_REGEX}
|
||||
* The version is validated by the regex defined in the static field {@link Version#VERSION_REGEX}
|
||||
*
|
||||
* Accepted initial version is {@link TypeVersion#MINIMAL_VERSION_STRING}
|
||||
* Accepted initial version is {@link Version#MINIMAL_VERSION_STRING}
|
||||
*
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
public class TypeVersion implements Comparable<TypeVersion> {
|
||||
public class Version implements Comparable<Version> {
|
||||
|
||||
/**
|
||||
* Regex validating the version
|
||||
*/
|
||||
public final static String TYPE_VERSION_REGEX = "^[1-9][0-9]{0,}\\.(0|([1-9][0-9]{0,}))\\.(0|([1-9][0-9]{0,}))$";
|
||||
public final static String VERSION_REGEX = "^[1-9][0-9]{0,}\\.(0|([1-9][0-9]{0,}))\\.(0|([1-9][0-9]{0,}))$";
|
||||
|
||||
private final static Pattern TYPE_VERSION_PATTERN;
|
||||
private final static Pattern VERSION_PATTERN;
|
||||
|
||||
/**
|
||||
* Accepted initial version
|
||||
|
@ -30,7 +30,7 @@ public class TypeVersion implements Comparable<TypeVersion> {
|
|||
/**
|
||||
* Accepted initial version as TypeVersion instance
|
||||
*/
|
||||
public static final TypeVersion MINIMAL_VERSION;
|
||||
public static final Version MINIMAL_VERSION;
|
||||
|
||||
/**
|
||||
* Default changelog description for the initial version
|
||||
|
@ -38,8 +38,8 @@ public class TypeVersion implements Comparable<TypeVersion> {
|
|||
public static final String MINIMAL_VERSION_DESCRIPTION = "First Version";
|
||||
|
||||
static {
|
||||
TYPE_VERSION_PATTERN = Pattern.compile(TYPE_VERSION_REGEX);
|
||||
MINIMAL_VERSION = new TypeVersion(MINIMAL_VERSION_STRING);
|
||||
VERSION_PATTERN = Pattern.compile(VERSION_REGEX);
|
||||
MINIMAL_VERSION = new Version(MINIMAL_VERSION_STRING);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
|
@ -49,13 +49,13 @@ public class TypeVersion implements Comparable<TypeVersion> {
|
|||
@JsonIgnore
|
||||
protected int revision;
|
||||
|
||||
protected TypeVersion(){}
|
||||
protected Version(){}
|
||||
|
||||
public TypeVersion(String version) {
|
||||
public Version(String version) {
|
||||
setVersion(version);
|
||||
}
|
||||
|
||||
public TypeVersion(int major, int minor, int revision) {
|
||||
public Version(int major, int minor, int revision) {
|
||||
this.major = major;
|
||||
this.minor = minor;
|
||||
this.revision = revision;
|
||||
|
@ -63,8 +63,8 @@ public class TypeVersion implements Comparable<TypeVersion> {
|
|||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
if(!TYPE_VERSION_PATTERN.matcher(version).matches()) {
|
||||
throw new RuntimeException("The provided version (i.e. " + version + ") MUST respect the regex " + TYPE_VERSION_REGEX);
|
||||
if(!VERSION_PATTERN.matcher(version).matches()) {
|
||||
throw new RuntimeException("The provided version (i.e. " + version + ") MUST respect the regex " + VERSION_REGEX);
|
||||
}
|
||||
String[] parts = version.split("\\.");
|
||||
this.major = Integer.valueOf(parts[0]);
|
||||
|
@ -114,7 +114,7 @@ public class TypeVersion implements Comparable<TypeVersion> {
|
|||
return major + "." + minor + "." + revision;
|
||||
}
|
||||
@Override
|
||||
public int compareTo(TypeVersion other) {
|
||||
public int compareTo(Version other) {
|
||||
if(other == null) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ public class TypeVersion implements Comparable<TypeVersion> {
|
|||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
TypeVersion other = (TypeVersion) obj;
|
||||
Version other = (Version) obj;
|
||||
if (major != other.major)
|
||||
return false;
|
||||
if (minor != other.minor)
|
|
@ -3,13 +3,13 @@ package org.gcube.informationsystem.types;
|
|||
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;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@TypeMetadata(name = "EntityParent", description = "This is a test Entity", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = "EntityParent", description = "This is a test Entity", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface EntityParent extends EntityParentParent {
|
||||
|
||||
@ISProperty(nullable=false)
|
||||
|
|
|
@ -3,13 +3,13 @@ package org.gcube.informationsystem.types;
|
|||
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;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@TypeMetadata(name = "EntityTest", description = "This is a test Entity", version = TypeVersion.MINIMAL_VERSION_STRING)
|
||||
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
|
||||
@TypeMetadata(name = "EntityTest", description = "This is a test Entity", version = Version.MINIMAL_VERSION_STRING)
|
||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||
public interface EntityTest extends EntityParent {
|
||||
|
||||
@ISProperty(nullable=false)
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.gcube.informationsystem.types.reference.relations.ConsistsOfType;
|
|||
import org.gcube.informationsystem.types.reference.relations.IsRelatedToType;
|
||||
import org.gcube.informationsystem.types.reference.relations.RelationType;
|
||||
import org.gcube.informationsystem.utils.ElementMapper;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -194,7 +194,7 @@ public class SerializationTest {
|
|||
logger.info(serialized);
|
||||
@SuppressWarnings("unchecked")
|
||||
PropertyType<Header> propertyType = (PropertyType<Header>) TypeMapper.deserializeTypeDefinition(serialized);
|
||||
TypeVersion typeVersion = propertyType.getVersion();
|
||||
Version typeVersion = propertyType.getVersion();
|
||||
logger.debug("Version {}", typeVersion.toString());
|
||||
logger.info(ElementMapper.marshal(propertyType));
|
||||
|
||||
|
|
|
@ -14,13 +14,13 @@ public class TypeVersionTest {
|
|||
@Test
|
||||
public void testPatterns() throws Exception {
|
||||
for(String version : validVersions) {
|
||||
TypeVersion typeVersion = new TypeVersion(version);
|
||||
Version typeVersion = new Version(version);
|
||||
Assert.assertTrue(version.compareTo(typeVersion.toString())==0);
|
||||
}
|
||||
|
||||
for(String version : inValidVersions) {
|
||||
try {
|
||||
TypeVersion typeVersion = new TypeVersion(version);
|
||||
Version typeVersion = new Version(version);
|
||||
throw new Exception("The version " + version + " is not valid but the validation succeded. Parsed version is " + typeVersion.toString());
|
||||
}catch (RuntimeException e) {
|
||||
// OK
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.gcube.informationsystem.types.TypeMapper;
|
|||
import org.gcube.informationsystem.types.reference.Type;
|
||||
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
||||
import org.gcube.informationsystem.types.reference.properties.PropertyType;
|
||||
import org.gcube.informationsystem.utils.TypeVersion;
|
||||
import org.gcube.informationsystem.utils.Version;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -44,13 +44,13 @@ public class ISMDiscoveryTest {
|
|||
Assert.assertTrue(expected.getSuperClasses().containsAll(type.getSuperClasses()));
|
||||
|
||||
|
||||
Map<TypeVersion, String> typeChangelog = type.getChangelog();
|
||||
Map<TypeVersion, String> typeManagedChangelog = expected.getChangelog();
|
||||
Map<Version, String> typeChangelog = type.getChangelog();
|
||||
Map<Version, String> typeManagedChangelog = expected.getChangelog();
|
||||
|
||||
Assert.assertTrue(typeChangelog.keySet().containsAll(typeManagedChangelog.keySet()));
|
||||
Assert.assertTrue(typeManagedChangelog.keySet().containsAll(typeChangelog.keySet()));
|
||||
|
||||
for(TypeVersion typeVersion : typeChangelog.keySet()) {
|
||||
for(Version typeVersion : typeChangelog.keySet()) {
|
||||
Assert.assertTrue(typeChangelog.get(typeVersion).compareTo(typeManagedChangelog.get(typeVersion))==0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue