java.lang.Object
java.lang.Record
it.auties.whatsapp.model.signal.session.SessionChain
public record SessionChain(AtomicInteger counter, AtomicReference<byte[]> key, ConcurrentHashMap<Integer,byte[]> messageKeys)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicIntegerThe field for thecounterrecord component.private final AtomicReference<byte[]> The field for thekeyrecord component.private final ConcurrentHashMap<Integer, byte[]> The field for themessageKeysrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSessionChain(int counter, byte[] key) SessionChain(AtomicInteger counter, AtomicReference<byte[]> key, ConcurrentHashMap<Integer, byte[]> messageKeys) Creates an instance of aSessionChainrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncounter()Returns the value of thecounterrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasMessageKey(int counter) AtomicReference<byte[]> key()Returns the value of thekeyrecord component.ConcurrentHashMap<Integer, byte[]> Returns the value of themessageKeysrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
counter
The field for thecounterrecord component. -
key
The field for thekeyrecord component. -
messageKeys
The field for themessageKeysrecord component.
-
-
Constructor Details
-
SessionChain
public SessionChain(int counter, byte[] key) -
SessionChain
public SessionChain(AtomicInteger counter, AtomicReference<byte[]> key, ConcurrentHashMap<Integer, byte[]> messageKeys) Creates an instance of aSessionChainrecord class.- Parameters:
counter- the value for thecounterrecord componentkey- the value for thekeyrecord componentmessageKeys- the value for themessageKeysrecord component
-
-
Method Details
-
hasMessageKey
public boolean hasMessageKey(int counter) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
counter
Returns the value of thecounterrecord component.- Returns:
- the value of the
counterrecord component
-
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
messageKeys
Returns the value of themessageKeysrecord component.- Returns:
- the value of the
messageKeysrecord component
-