Package xyz.tcheeric.cashu.voucher.pass
Record Class PassJson.Field
java.lang.Object
java.lang.Record
xyz.tcheeric.cashu.voucher.pass.PassJson.Field
- Enclosing class:
PassJson
public static record PassJson.Field(String key, String label, Object value, String currencyCode, String dateStyle)
extends Record
One displayed field.
currencyCode and dateStyle are mutually exclusive — a field is
a currency or a date, never both.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecurrencyCoderecord component.Returns the value of thedateStylerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.label()Returns the value of thelabelrecord component.static PassJson.FieldA plain field with no currency or date formatting.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Field
Creates an instance of aFieldrecord class.- Parameters:
key- the value for thekeyrecord componentlabel- the value for thelabelrecord componentvalue- the value for thevaluerecord componentcurrencyCode- the value for thecurrencyCoderecord componentdateStyle- the value for thedateStylerecord component
-
-
Method Details
-
of
A plain field with no currency or date formatting.- Parameters:
key- field keylabel- displayed labelvalue- displayed value- Returns:
- the field
-
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). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
currencyCode
Returns the value of thecurrencyCoderecord component.- Returns:
- the value of the
currencyCoderecord component
-
dateStyle
Returns the value of thedateStylerecord component.- Returns:
- the value of the
dateStylerecord component
-