package com.juick.server.api.activity.model; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.juick.server.api.activity.helpers.ActivityIdDeserializer; import org.apache.commons.lang3.StringUtils; import java.util.UUID; public abstract class Activity extends Context { @JsonDeserialize(using = ActivityIdDeserializer.class) private String actor; private Object object; public String getActor() { return actor; } public void setActor(String actor) { this.actor = actor; if (StringUtils.isEmpty(getId())) { setId(String.format("%s#%s", this.actor, UUID.randomUUID().toString())); } } public Object getObject() { return object; } public void setObject(Object object) { this.object = object; } }