Record Class PushKeyFiles.VapidKeyFile

java.lang.Object
java.lang.Record
com.iizix.push.PushKeyFiles.VapidKeyFile
Record Components:
file - The file, absolute and normalized.
publicKey - VPubKey, base64url.
privateKey - VPrivKey, base64url. Never printed.
Enclosing class:
PushKeyFiles

public static record PushKeyFiles.VapidKeyFile(Path file, String publicKey, String privateKey) extends Record
A VAPID key file as read: the pair it holds, validated and belonging together.
Author:
Christopher Mindus
  • Constructor Details

    • VapidKeyFile

      public VapidKeyFile(Path file, String publicKey, String privateKey)
      Creates an instance of a VapidKeyFile record class.
      Parameters:
      file - the value for the file record component
      publicKey - the value for the publicKey record component
      privateKey - the value for the privateKey record component
  • Method Details

    • toString

      public String toString()
      Never the private key.
      Specified by:
      toString in class Record
      Returns:
      The file and the public key.
    • 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
    • equals

      public final boolean equals(Object o)
      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:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • file

      public Path file()
      Returns the value of the file record component.
      Returns:
      the value of the file record component
    • publicKey

      public String publicKey()
      Returns the value of the publicKey record component.
      Returns:
      the value of the publicKey record component
    • privateKey

      public String privateKey()
      Returns the value of the privateKey record component.
      Returns:
      the value of the privateKey record component