Adding support for Resource schema definition

This commit is contained in:
Luca Frosini 2020-01-17 17:03:33 +01:00
parent 6e73f54de5
commit 1e84cd6607
3 changed files with 10 additions and 3 deletions

View File

@ -87,7 +87,7 @@ public final class ResourceEntryDefinitionImpl extends BasePropertyImpl implemen
@Override
public void setMax(Integer max) {
if(max<=0) {
if(max==null || max<=0) {
this.max = null;
}else {
this.max = max;

View File

@ -2,6 +2,7 @@ package org.gcube.informationsystem.types.reference.entities;
import java.util.List;
import org.gcube.informationsystem.types.annotations.ISProperty;
import org.gcube.informationsystem.types.impl.entities.ResourceTypeDefinitionImpl;
import org.gcube.informationsystem.types.reference.properties.ResourceEntryDefinition;
@ -14,7 +15,13 @@ public interface ResourceTypeDefinition extends EntityTypeDefinition {
public static final String DESCRIPTION = "Used to define a Resource Type";
public static final String VERSION = "1.0.0";
public static final String FACETS_PROPERTY = "facets";
public static final String RESOURCES_PROPERTY = "resources";
@ISProperty(name = FACETS_PROPERTY, readonly = false, mandatory = true, nullable = false)
public List<ResourceEntryDefinition> getFacets();
@ISProperty(name = RESOURCES_PROPERTY, readonly = false, mandatory = true, nullable = false)
public List<ResourceEntryDefinition> getResources();
}

View File

@ -38,12 +38,12 @@ public interface ResourceEntryDefinition extends BaseProperty {
public void setDescription(String description);
@ISProperty(name = MIN_PROPERTY, readonly = false, mandatory = true, nullable = false)
@ISProperty(name = MIN_PROPERTY, readonly = true, mandatory = true, nullable = false)
public Integer getMin();
public void setMin(Integer min);
@ISProperty(name = MAX_PROPERTY, readonly = false, mandatory = true, nullable = true)
@ISProperty(name = MAX_PROPERTY, readonly = true, mandatory = true, nullable = true)
public Integer getMax();
public void setMax(Integer max);