import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.annotations.SerializedName;
public class ChampEvent {
private ChampOperation operation;
private long timestamp;
- @SerializedName("transaction-id")
private String transactionId = null;
private ChampObject vertex = null;
private ChampRelationship relationship = null;
private ChampPartition partition = null;
private ChampObjectIndex objectIndex = null;
private ChampRelationshipIndex relationshipIndex = null;
- @SerializedName("database-transaction-id")
private String dbTransactionId = null;
return dbTransactionId;
}
-
public void setDbTransactionId(String id) {
this.dbTransactionId = id;
}
-
-
public String toJson() {
-
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(Include.NON_NULL);
}
public static ChampEvent fromJson(String json) throws JsonParseException, JsonMappingException, IOException {
-
mapper.setSerializationInclusion(Include.NON_NULL);
return mapper.readValue(json, ChampEvent.class);
}
@Override
public String toString() {
-
return toJson();
}
ChampEvent event = null;
-
public Builder() {
event = new ChampEvent();
}
return this;
}
-
public ChampEvent build() {
-
event.setTimestamp(System.currentTimeMillis());
// Set a unique transaction id on this event that can be used by downstream entities