Skip to content

Commit

Permalink
feat: changed LocalDateTime to Instant
Browse files Browse the repository at this point in the history
  • Loading branch information
xchopin committed Jan 28, 2019
1 parent a049e16 commit 8bedaa8
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 90 deletions.
19 changes: 8 additions & 11 deletions src/main/java/unicon/matthews/caliper/Agent.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
*
*/
package unicon.matthews.caliper;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.Instant;
import java.util.Map;

import javax.validation.constraints.NotNull;
Expand All @@ -20,7 +17,7 @@

/**
* @author ggilbert
*
* @author xchopin <[email protected]>
*/
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand All @@ -43,8 +40,8 @@ public class Agent implements Serializable {
private String name;
private String description;
private Map<String, String> extensions;
private LocalDateTime dateCreated;
private LocalDateTime dateModified;
private Instant dateCreated;
private Instant dateModified;

private Agent() {}

Expand Down Expand Up @@ -72,11 +69,11 @@ public Map<String, String> getExtensions() {
return extensions;
}

public LocalDateTime getDateCreated() {
public Instant getDateCreated() {
return dateCreated;
}

public LocalDateTime getDateModified() {
public Instant getDateModified() {
return dateModified;
}

Expand Down Expand Up @@ -200,12 +197,12 @@ public Builder withExtensions(Map<String,String> extensions) {
return this;
}

public Builder withDateCreated(LocalDateTime dateCreated) {
public Builder withDateCreated(Instant dateCreated) {
_agent.dateCreated = dateCreated;
return this;
}

public Builder withDateModified(LocalDateTime dataModified) {
public Builder withDateModified(Instant dataModified) {
_agent.dateModified = dataModified;
return this;
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/unicon/matthews/caliper/ClassEventStatistics.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/**
*
*/
package unicon.matthews.caliper;

import java.util.Map;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;


/**
* @author ggilbert
*
* @author xchopin <[email protected]>
*/
public class ClassEventStatistics {
private String classSourcedId;
Expand Down
26 changes: 12 additions & 14 deletions src/main/java/unicon/matthews/caliper/Entity.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
*
*/
package unicon.matthews.caliper;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.Instant;
import java.util.List;
import java.util.Map;

Expand All @@ -19,9 +16,10 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;


/**
* @author ggilbert
*
* @author xchopin <[email protected]>
*/
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand All @@ -43,14 +41,14 @@ public class Entity implements Serializable {
private String name;
private String description;
private Map<String, String> extensions;
private LocalDateTime dateCreated;
private LocalDateTime dateModified;
private Instant dateCreated;
private Instant dateModified;

private List<String> objectType;
private List<LearningObject> alignedLearningObjective;
private List<String> keywords;
private Entity isPartOf;
private LocalDateTime datePublished;
private Instant datePublished;
private String version;
private String duration;
private String currentTime;
Expand Down Expand Up @@ -92,11 +90,11 @@ public Map<String, String> getExtensions() {
return extensions;
}

public LocalDateTime getDateCreated() {
public Instant getDateCreated() {
return dateCreated;
}

public LocalDateTime getDateModified() {
public Instant getDateModified() {
return dateModified;
}

Expand All @@ -116,7 +114,7 @@ public Entity getIsPartOf() {
return isPartOf;
}

public LocalDateTime getDatePublished() {
public Instant getDatePublished() {
return datePublished;
}

Expand Down Expand Up @@ -400,12 +398,12 @@ public Builder withExtensions(Map<String,String> extensions) {
return this;
}

public Builder withDateCreated(LocalDateTime dateCreated) {
public Builder withDateCreated(Instant dateCreated) {
_entity.dateCreated = dateCreated;
return this;
}

public Builder withDateModified(LocalDateTime dataModified) {
public Builder withDateModified(Instant dataModified) {
_entity.dateModified = dataModified;
return this;
}
Expand All @@ -430,7 +428,7 @@ public Builder withIsPartOf(Entity isPartOf) {
return this;
}

public Builder withDatePublished(LocalDateTime datePublished) {
public Builder withDatePublished(Instant datePublished) {
_entity.datePublished = datePublished;
return this;
}
Expand Down
14 changes: 6 additions & 8 deletions src/main/java/unicon/matthews/caliper/Envelope.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
*
*/
package unicon.matthews.caliper;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.Instant;
import java.util.List;

import javax.validation.constraints.NotNull;
Expand All @@ -17,9 +14,10 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;


/**
* @author ggilbert
*
* @author xchopin <[email protected]>
*/
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand All @@ -31,7 +29,7 @@ public class Envelope implements Serializable {
private String sensor;

@NotNull
private LocalDateTime sendTime;
private Instant sendTime;

@NotNull
private List<Event> data;
Expand All @@ -42,7 +40,7 @@ public String getSensor() {
return sensor;
}

public LocalDateTime getSendTime() {
public Instant getSendTime() {
return sendTime;
}

Expand Down Expand Up @@ -100,7 +98,7 @@ public Builder withSensor(String sensor) {
return this;
}

public Builder withSendTime(LocalDateTime sendTime) {
public Builder withSendTime(Instant sendTime) {
_envelope.sendTime = sendTime;
return this;
}
Expand Down
13 changes: 5 additions & 8 deletions src/main/java/unicon/matthews/caliper/Event.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
*
*/
package unicon.matthews.caliper;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.Instant;

import javax.validation.constraints.NotNull;

Expand All @@ -19,7 +16,7 @@

/**
* @author ggilbert
*
* @author xchopin <[email protected]>
*/
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand Down Expand Up @@ -49,7 +46,7 @@ public class Event implements Serializable {
private Entity generated;
private Group group;
private Membership membership;
private LocalDateTime eventTime;
private Instant eventTime;
private String federatedSession;

private Event() {}
Expand Down Expand Up @@ -102,7 +99,7 @@ public String getFederatedSession() {
return federatedSession;
}

public LocalDateTime getEventTime() {
public Instant getEventTime() {
return eventTime;
}

Expand Down Expand Up @@ -275,7 +272,7 @@ public Builder withMembership(Membership membership) {
return this;
}

public Builder withEventTime(LocalDateTime eventTime) {
public Builder withEventTime(Instant eventTime) {
_basicEvent.eventTime = eventTime;
return this;
}
Expand Down
20 changes: 9 additions & 11 deletions src/main/java/unicon/matthews/caliper/Group.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
*
*/
package unicon.matthews.caliper;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.Instant;
import java.util.Map;

import javax.validation.constraints.NotNull;
Expand All @@ -18,9 +15,10 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;


/**
* @author ggilbert
*
* @author xchopin <[email protected]>
*/
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand All @@ -43,8 +41,8 @@ public class Group implements Serializable {
private String name;
private String description;
private Map<String, String> extensions;
private LocalDateTime dateCreated;
private LocalDateTime dateModified;
private Instant dateCreated;
private Instant dateModified;

private SubOrganizationOf subOrganizationOf;

Expand Down Expand Up @@ -76,11 +74,11 @@ public Map<String, String> getExtensions() {
return extensions;
}

public LocalDateTime getDateCreated() {
public Instant getDateCreated() {
return dateCreated;
}

public LocalDateTime getDateModified() {
public Instant getDateModified() {
return dateModified;
}

Expand Down Expand Up @@ -224,12 +222,12 @@ public Builder withExtensions(Map<String,String> extensions) {
return this;
}

public Builder withDateCreated(LocalDateTime dateCreated) {
public Builder withDateCreated(Instant dateCreated) {
_group.dateCreated = dateCreated;
return this;
}

public Builder withDateModified(LocalDateTime dataModified) {
public Builder withDateModified(Instant dataModified) {
_group.dateModified = dataModified;
return this;
}
Expand Down
21 changes: 9 additions & 12 deletions src/main/java/unicon/matthews/caliper/LearningObject.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/**
*
*/
package unicon.matthews.caliper;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.Instant;
import java.util.Map;

import javax.validation.constraints.NotNull;
Expand All @@ -18,9 +15,9 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

/**
/*
* @author ggilbert
*
* @author xchopin <[email protected]>
*/
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
Expand All @@ -43,8 +40,8 @@ public class LearningObject implements Serializable {
private String name;
private String description;
private Map<String, String> extensions;
private LocalDateTime dateCreated;
private LocalDateTime dateModified;
private Instant dateCreated;
private Instant dateModified;

private LearningObject() {}

Expand Down Expand Up @@ -72,11 +69,11 @@ public Map<String, String> getExtensions() {
return extensions;
}

public LocalDateTime getDateCreated() {
public Instant getDateCreated() {
return dateCreated;
}

public LocalDateTime getDateModified() {
public Instant getDateModified() {
return dateModified;
}

Expand Down Expand Up @@ -200,12 +197,12 @@ public Builder withExtensions(Map<String,String> extensions) {
return this;
}

public Builder withDateCreated(LocalDateTime dateCreated) {
public Builder withDateCreated(Instant dateCreated) {
_learningObject.dateCreated = dateCreated;
return this;
}

public Builder withDateModified(LocalDateTime dataModified) {
public Builder withDateModified(Instant dataModified) {
_learningObject.dateModified = dataModified;
return this;
}
Expand Down
Loading

0 comments on commit 8bedaa8

Please sign in to comment.