Record Class JournalEntry
java.lang.Object
java.lang.Record
io.leandev.appfuse.file.tx.JournalEntry
- Record Components:
timestamp- 事件發生時間op- 操作類型state- 交易生命週期狀態partition- 儲存分區鍵(同 FileStorage 的 partition 參數)fileId- 永久區檔案 ID(操作對象)tempId- persist 的來源暫存 ID;store/delete 為 nulltxName- 交易名稱(除錯關聯用,可為 null)
public record JournalEntry(Instant timestamp, JournalOp op, JournalState state, String partition, String fileId, String tempId, String txName)
extends Record
檔案交易日誌的單筆事件(不可變值物件)
由 TransactionAwareFileStorage 在各交易 hook 點產生,交由 FileJournal 持久化。
-
Constructor Summary
ConstructorsConstructorDescriptionJournalEntry(Instant timestamp, JournalOp op, JournalState state, String partition, String fileId, String tempId, String txName) Creates an instance of aJournalEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.fileId()Returns the value of thefileIdrecord component.final inthashCode()Returns a hash code value for this object.static JournalEntry以當下時間建立一筆事件op()Returns the value of theoprecord component.Returns the value of thepartitionrecord component.state()Returns the value of thestaterecord component.tempId()Returns the value of thetempIdrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.txName()Returns the value of thetxNamerecord component.
-
Constructor Details
-
JournalEntry
public JournalEntry(Instant timestamp, JournalOp op, JournalState state, String partition, String fileId, String tempId, String txName) Creates an instance of aJournalEntryrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentop- the value for theoprecord componentstate- the value for thestaterecord componentpartition- the value for thepartitionrecord componentfileId- the value for thefileIdrecord componenttempId- the value for thetempIdrecord componenttxName- the value for thetxNamerecord component
-
-
Method Details
-
of
public static JournalEntry of(JournalOp op, JournalState state, String partition, String fileId, String tempId, String txName) 以當下時間建立一筆事件 -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
timestamp
-
op
-
state
-
partition
-
fileId
-
tempId
-
txName
-