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 java.lang.Object
Collection of transaction updates to be applied atomically.
-
-
Constructor Summary
Constructors Constructor Description TransactionLog(TransactionId transactionId, long version, java.util.List<T> records)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
int
hashCode()
<U> TransactionLog<U>
map(java.util.function.Function<T,U> mapper)
Maps this instance to anotherMapTransaction
with different key and value types.java.util.List<T>
records()
Returns the list of transaction log records.java.lang.String
toString()
TransactionId
transactionId()
Returns the transaction identifier.long
version()
Returns the transaction lock version.
-
-
-
Constructor Detail
-
TransactionLog
public TransactionLog(TransactionId transactionId, long version, java.util.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 java.util.List<T> records()
Returns the list of transaction log records.- Returns:
- a list of transaction log records
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
map
public <U> TransactionLog<U> map(java.util.function.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
-
-