Package org.onosproject.store.service
Class TransactionLog<T>
- java.lang.Object
-
- org.onosproject.store.service.TransactionLog<T>
-
- Type Parameters:
T
- log record type
public class TransactionLog<T> extends Object
Collection of transaction updates to be applied atomically.
-
-
Constructor Summary
Constructors Constructor Description TransactionLog(TransactionId transactionId, long version, List<T> records)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
int
hashCode()
<U> TransactionLog<U>
map(Function<T,U> mapper)
Maps this instance to anotherMapTransaction
with different key and value types.List<T>
records()
Returns the list of transaction log records.String
toString()
TransactionId
transactionId()
Returns the transaction identifier.long
version()
Returns the transaction lock version.
-
-
-
Constructor Detail
-
TransactionLog
public TransactionLog(TransactionId transactionId, long version, List<T> records)
-
-
Method Detail
-
transactionId
public TransactionId transactionId()
Returns the transaction identifier.- Returns:
- transaction id
-
version
public long version()
Returns the transaction lock version.- Returns:
- the transaction lock version
-
records
public List<T> records()
Returns the list of transaction log records.- Returns:
- a list of transaction log records
-
map
public <U> TransactionLog<U> map(Function<T,U> mapper)
Maps this instance to anotherMapTransaction
with different key and value types.- Type Parameters:
U
- record type of returned instance- Parameters:
mapper
- function for mapping record types- Returns:
- newly typed instance
-
-