2016-10-31 16:43:48 +01:00
|
|
|
package com.baeldung.mdc;
|
|
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
public class TransactionContext {
|
|
|
|
|
|
|
|
|
|
private String transactionId;
|
|
|
|
|
private String owner;
|
|
|
|
|
private Date createdAt;
|
2016-11-01 22:49:32 +01:00
|
|
|
private Long amount;
|
2016-10-31 16:43:48 +01:00
|
|
|
|
|
|
|
|
public TransactionContext(String transactionId, String owner) {
|
|
|
|
|
this.transactionId = transactionId;
|
|
|
|
|
this.owner = owner;
|
|
|
|
|
this.createdAt = new Date();
|
2016-11-01 22:49:32 +01:00
|
|
|
this.amount = (long) (Math.random()*100);
|
2016-10-31 16:43:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getOwner() {
|
|
|
|
|
return owner;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getTransactionId() {
|
|
|
|
|
return transactionId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Date getCreatedAt() {
|
|
|
|
|
return createdAt;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-01 22:49:32 +01:00
|
|
|
public Long getAmount() {
|
|
|
|
|
return amount;
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-31 16:43:48 +01:00
|
|
|
}
|