Record Class PassJson

java.lang.Object
java.lang.Record
xyz.tcheeric.cashu.voucher.pass.PassJson

public record PassJson(int formatVersion, String passTypeIdentifier, String teamIdentifier, String serialNumber, String description, String organizationName, String logoText, String backgroundColor, String foregroundColor, String labelColor, String expirationDate, boolean voided, PassJson.StoreCard storeCard, List<PassJson.Barcode> barcodes, Map<String,Object> userInfo) extends Record
The subset of Apple's pass.json schema this project emits.

We adopt the schema, not the platform: there is no certificate, no .pkpass container, and no pass update web service. Apple Wallet never renders these documents — imani's own wallet does. passTypeIdentifier and teamIdentifier are schema-required and carry no meaning here.

Modelled by hand rather than via jPasskit: that library drags an APNs push client and Netty into the dependency tree, which contradicts this module's design.

Serialisation is the caller's — this module declares only Jackson annotations. Nulls are omitted so optional keys stay absent rather than appearing as null, which Apple's schema does not permit.

  • Constructor Details

    • PassJson

      public PassJson(int formatVersion, String passTypeIdentifier, String teamIdentifier, String serialNumber, String description, String organizationName, String logoText, String backgroundColor, String foregroundColor, String labelColor, String expirationDate, boolean voided, PassJson.StoreCard storeCard, List<PassJson.Barcode> barcodes, Map<String,Object> userInfo)
      Creates an instance of a PassJson record class.
      Parameters:
      formatVersion - the value for the formatVersion record component
      passTypeIdentifier - the value for the passTypeIdentifier record component
      teamIdentifier - the value for the teamIdentifier record component
      serialNumber - the value for the serialNumber record component
      description - the value for the description record component
      organizationName - the value for the organizationName record component
      logoText - the value for the logoText record component
      backgroundColor - the value for the backgroundColor record component
      foregroundColor - the value for the foregroundColor record component
      labelColor - the value for the labelColor record component
      expirationDate - the value for the expirationDate record component
      voided - the value for the voided record component
      storeCard - the value for the storeCard record component
      barcodes - the value for the barcodes record component
      userInfo - the value for the userInfo record component
  • Method Details

    • 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
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • formatVersion

      public int formatVersion()
      Returns the value of the formatVersion record component.
      Returns:
      the value of the formatVersion record component
    • passTypeIdentifier

      public String passTypeIdentifier()
      Returns the value of the passTypeIdentifier record component.
      Returns:
      the value of the passTypeIdentifier record component
    • teamIdentifier

      public String teamIdentifier()
      Returns the value of the teamIdentifier record component.
      Returns:
      the value of the teamIdentifier record component
    • serialNumber

      public String serialNumber()
      Returns the value of the serialNumber record component.
      Returns:
      the value of the serialNumber record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • organizationName

      public String organizationName()
      Returns the value of the organizationName record component.
      Returns:
      the value of the organizationName record component
    • logoText

      public String logoText()
      Returns the value of the logoText record component.
      Returns:
      the value of the logoText record component
    • backgroundColor

      public String backgroundColor()
      Returns the value of the backgroundColor record component.
      Returns:
      the value of the backgroundColor record component
    • foregroundColor

      public String foregroundColor()
      Returns the value of the foregroundColor record component.
      Returns:
      the value of the foregroundColor record component
    • labelColor

      public String labelColor()
      Returns the value of the labelColor record component.
      Returns:
      the value of the labelColor record component
    • expirationDate

      public String expirationDate()
      Returns the value of the expirationDate record component.
      Returns:
      the value of the expirationDate record component
    • voided

      public boolean voided()
      Returns the value of the voided record component.
      Returns:
      the value of the voided record component
    • storeCard

      public PassJson.StoreCard storeCard()
      Returns the value of the storeCard record component.
      Returns:
      the value of the storeCard record component
    • barcodes

      public List<PassJson.Barcode> barcodes()
      Returns the value of the barcodes record component.
      Returns:
      the value of the barcodes record component
    • userInfo

      public Map<String,Object> userInfo()
      Returns the value of the userInfo record component.
      Returns:
      the value of the userInfo record component