Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ public enum DataType {
STRING,

/** List of same type */
LIST;
LIST,

/** Date value */
DATE,

/** Timestamp value */
TIMESTAMP;

public static DataType fromString(String s) {
switch (s) {
Expand All @@ -57,6 +63,10 @@ public static DataType fromString(String s) {
return STRING;
case "list":
return LIST;
case "date":
return DATE;
case "timestamp":
return TIMESTAMP;
default:
throw new IllegalArgumentException("Unknown data type: " + s);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ public void testPropertyWithAllDataTypes() {
Property listProp = TestDataFactory.createProperty("items", DataType.LIST, false, true);
Assert.assertEquals(DataType.LIST, listProp.getDataType());
TestVerificationUtils.verifyProperty(listProp, "items", false, true);

// Newly added data types
Property dateProp =
TestDataFactory.createProperty("creationDate", DataType.DATE, false, true);
Assert.assertEquals(DataType.DATE, dateProp.getDataType());
TestVerificationUtils.verifyProperty(dateProp, "creationDate", false, true);

Property timestampProp =
TestDataFactory.createProperty("createdAt", DataType.TIMESTAMP, false, true);
Assert.assertEquals(DataType.TIMESTAMP, timestampProp.getDataType());
TestVerificationUtils.verifyProperty(timestampProp, "createdAt", false, true);
}

@Test
Expand Down