io.snice.protocol.TransactionSupport Maven / Gradle / Ivy
package io.snice.protocol;
import java.util.Optional;
public abstract class TransactionSupport implements Transaction {
private final TransactionId transactionId;
private final O owner;
private final Optional payload;
protected TransactionSupport(final TransactionId transactionId, final O owner, final Optional payload) {
this.transactionId = transactionId;
this.owner = owner;
this.payload = payload;
}
protected TransactionSupport(final TransactionId transactionId, final O owner) {
this(transactionId, owner, Optional.empty());
}
@Override
public Optional getPayload() {
return payload;
}
@Override
public final O getOwner() {
return owner;
}
@Override
public final TransactionId getTransactionId() {
return transactionId;
}
}