Record Class SaleView
java.lang.Object
java.lang.Record
de.chojo.universalis.websocket.events.concrete.sales.views.SaleView
- Record Components:
hq
- Whether the item was high-quality.pricePerUnit
- The price per unit sold.quantity
- The stack size sold.timestamp
- The sale time, in seconds since the UNIX epoch.onMannequin
- Whether this was purchased from a mannequin.worldName
- The world name, if applicable.worldId
- The world ID, if applicable.buyerName
- The buyer name.total
- The total price.
public record SaleView(boolean hq, int pricePerUnit, int quantity, LocalDateTime timestamp, boolean onMannequin, String worldName, int worldId, String buyerName, int total)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionSaleView
(boolean hq, int pricePerUnit, int quantity, LocalDateTime timestamp, boolean onMannequin, String worldName, int worldId, String buyerName, int total) Creates an instance of aSaleView
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebuyerName
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
hq()
Returns the value of thehq
record component.boolean
Returns the value of theonMannequin
record component.int
Returns the value of thepricePerUnit
record component.int
quantity()
Returns the value of thequantity
record component.Returns the value of thetimestamp
record component.final String
toString()
Returns a string representation of this record class.int
total()
Returns the value of thetotal
record component.int
worldId()
Returns the value of theworldId
record component.Returns the value of theworldName
record component.
-
Constructor Details
-
SaleView
public SaleView(boolean hq, int pricePerUnit, int quantity, LocalDateTime timestamp, boolean onMannequin, String worldName, int worldId, String buyerName, int total) Creates an instance of aSaleView
record class.- Parameters:
hq
- the value for thehq
record componentpricePerUnit
- the value for thepricePerUnit
record componentquantity
- the value for thequantity
record componenttimestamp
- the value for thetimestamp
record componentonMannequin
- the value for theonMannequin
record componentworldName
- the value for theworldName
record componentworldId
- the value for theworldId
record componentbuyerName
- the value for thebuyerName
record componenttotal
- the value for thetotal
record component
-
-
Method Details
-
toSale
- Parameters:
world
- world for the sale- Returns:
- list of sales
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
hq
public boolean hq()Returns the value of thehq
record component.- Returns:
- the value of the
hq
record component
-
pricePerUnit
public int pricePerUnit()Returns the value of thepricePerUnit
record component.- Returns:
- the value of the
pricePerUnit
record component
-
quantity
public int quantity()Returns the value of thequantity
record component.- Returns:
- the value of the
quantity
record component
-
timestamp
Returns the value of thetimestamp
record component.- Returns:
- the value of the
timestamp
record component
-
onMannequin
public boolean onMannequin()Returns the value of theonMannequin
record component.- Returns:
- the value of the
onMannequin
record component
-
worldName
Returns the value of theworldName
record component.- Returns:
- the value of the
worldName
record component
-
worldId
public int worldId()Returns the value of theworldId
record component.- Returns:
- the value of the
worldId
record component
-
buyerName
Returns the value of thebuyerName
record component.- Returns:
- the value of the
buyerName
record component
-
total
public int total()Returns the value of thetotal
record component.- Returns:
- the value of the
total
record component
-