it.contactlab.hub.sdk.java.models.AbstractOtherEvent Maven / Gradle / Ivy
package it.contactlab.hub.sdk.java.models;
import org.immutables.value.Value;
import java.time.OffsetDateTime;
import java.util.Map;
import java.util.Optional;
/**
* An Event made in other context.
*/
@Value.Immutable
@Value.Style(typeImmutable = "*")
public abstract class AbstractOtherEvent extends Event {
/**
* The ID of this Event.
*/
public abstract Optional id();
/**
* The CustomerId for this Event.
*/
public abstract Optional customerId();
/**
* The ExternalId for this Event.
*/
public abstract Optional externalId();
/**
* The SessionId for this Event.
*/
public abstract Optional sessionId();
/**
* The event type of this Event.
*/
public abstract EventType type();
/**
* The event context of this Event.
*/
@Value.Derived
public EventContext context() {
return EventContext.OTHER;
}
/**
* The properties of this Event.
*/
public abstract Map properties();
/**
* The context-specific properties of this Event.
*/
@Override
public abstract Optional contextInfo();
/**
* The moment when this Event happened.
*
* It defaults to "now()" if not specified when creating a new Event.
*/
@Value.Default
public OffsetDateTime date() {
return OffsetDateTime.now();
}
/**
* The moment when this Event was registered.
*/
public abstract Optional registeredAt();
}