Record Class SignalKeyPair

java.lang.Object
java.lang.Record
it.auties.whatsapp.model.signal.keypair.SignalKeyPair
All Implemented Interfaces:
ISignalKeyPair

public record SignalKeyPair(byte[] publicKey, byte[] privateKey) extends Record implements ISignalKeyPair
  • Field Details

    • publicKey

      private final byte[] publicKey
      The field for the publicKey record component.
    • privateKey

      private final byte[] privateKey
      The field for the privateKey record component.
  • Constructor Details

    • SignalKeyPair

      public SignalKeyPair(byte[] publicKey, byte[] privateKey)
      Creates an instance of a SignalKeyPair record class.
      Parameters:
      publicKey - the value for the publicKey record component
      privateKey - the value for the privateKey record component
  • Method Details

    • of

      public static SignalKeyPair of(byte[] publicKey)
    • random

      public static SignalKeyPair random()
    • equals

      public boolean equals(Object other)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      other - the object with which to compare
      Returns:
      true if this object is the same as the other argument; false otherwise.
    • toNode

      public Node toNode()
      Specified by:
      toNode in interface ISignalKeyPair
    • toGenericKeyPair

      public SignalKeyPair toGenericKeyPair()
      Specified by:
      toGenericKeyPair in interface ISignalKeyPair
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • publicKey

      public byte[] publicKey()
      Returns the value of the publicKey record component.
      Specified by:
      publicKey in interface ISignalKeyPair
      Returns:
      the value of the publicKey record component
    • privateKey

      public byte[] privateKey()
      Returns the value of the privateKey record component.
      Specified by:
      privateKey in interface ISignalKeyPair
      Returns:
      the value of the privateKey record component