com.enonic.xp.event.Event Maven / Gradle / Ivy
package com.enonic.xp.event;
import java.io.Serializable;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.enonic.xp.convert.Converters;
public final class Event
implements Serializable
{
private static final long serialVersionUID = 0;
private final String type;
private final long timestamp;
private final boolean distributed;
private final boolean localOrigin;
private final ImmutableMap data;
private Event( final Builder builder )
{
this.type = builder.type;
this.timestamp = builder.timestamp;
this.distributed = builder.distributed;
this.data = builder.dataBuilder.build();
this.localOrigin = builder.localOrigin;
}
public String getType()
{
return this.type;
}
public long getTimestamp()
{
return this.timestamp;
}
public boolean isDistributed()
{
return this.distributed;
}
public Map getData()
{
return this.data;
}
public Optional