Fixing Model

This commit is contained in:
Luca Frosini 2020-02-04 09:44:10 +01:00
parent 1c80f165b6
commit 9858c50c99
3 changed files with 8 additions and 10 deletions

View File

@ -22,4 +22,9 @@ public interface Element extends Serializable {
public static final String SUPERCLASSES_PROPERTY = "@superClasses";
/**
* DateTime Pattern to be used to serialize Dates in every element
*/
public static final String DATETIME_PATTERN = "yyyy-MM-dd HH:mm:ss.SSS Z";
}

View File

@ -1,7 +0,0 @@
package org.gcube.informationsystem.base.reference;
public interface ISConstants {
String DATETIME_PATTERN = "yyyy-MM-dd HH:mm:ss.SSS Z";
}

View File

@ -6,7 +6,7 @@ package org.gcube.informationsystem.model.reference.properties;
import java.util.Date;
import java.util.UUID;
import org.gcube.informationsystem.base.reference.ISConstants;
import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.model.impl.properties.HeaderImpl;
import org.gcube.informationsystem.types.annotations.ISProperty;
@ -41,14 +41,14 @@ public interface Header extends Property {
@ISProperty(name = CREATOR_PROPERTY, readonly = true, mandatory = true, nullable = false)
public String getCreator();
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = ISConstants.DATETIME_PATTERN)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Element.DATETIME_PATTERN)
@ISProperty(name = CREATION_TIME_PROPERTY, readonly = true, mandatory = true, nullable = false)
public Date getCreationTime();
@ISProperty(name = MODIFIED_BY_PROPERTY, mandatory = true, nullable = false)
public String getModifiedBy();
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = ISConstants.DATETIME_PATTERN)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Element.DATETIME_PATTERN)
@ISProperty(name = LAST_UPDATE_TIME_PROPERTY, mandatory = true, nullable = false)
public Date getLastUpdateTime();