From f92d133de4210c95914457d37ab7e807c129db80 Mon Sep 17 00:00:00 2001 From: justflatley Date: Fri, 16 Jun 2023 14:54:02 -0500 Subject: [PATCH] Create ActivityModel.java Adding initial user activity model --- .../common/models/activity/ActivityModel.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 portability-types-common/src/main/java/org/datatransferproject/types/common/models/activity/ActivityModel.java diff --git a/portability-types-common/src/main/java/org/datatransferproject/types/common/models/activity/ActivityModel.java b/portability-types-common/src/main/java/org/datatransferproject/types/common/models/activity/ActivityModel.java new file mode 100644 index 000000000..47bedca82 --- /dev/null +++ b/portability-types-common/src/main/java/org/datatransferproject/types/common/models/activity/ActivityModel.java @@ -0,0 +1,37 @@ +package org.datatransferproject.types.common.models.activity; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Instant; + +public class ActivityModel { + private final String service; + private final String action; + private final Instant timestamp; + + @JsonCreator + public ActivityModel( + @JsonProperty("service") String service, + @JsonProperty("action") String action, + @JsonProperty("timestamp") Instant timestamp) { + this.service = service; + this.action = action; + this.timestamp = timestamp; + } + + public String getService() { + return service; + } + + public String getAction() { + return action; + } + + public Instant gettimestamp() { return timestamp; } + + @Override + public int hashCode() { + return Objects.hash(getService(), getAction(), gettimestamp()); + } + +} \ No newline at end of file