Package application.schema
Record Class Order
java.lang.Object
java.lang.Record
application.schema.Order
- Record Components:
_id
- of the ordercustomerEmail
- email of the customer that made the orderprice
- total price of the ordertype
- type of the orderstate
- current state of the orderitems
- ordered menu items
public record Order(String _id, String customerEmail, int price, String type, String state, List<OrderItem> items)
extends Record
Order Schema
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_id()
Returns the value of the_id
record component.Returns the value of thecustomerEmail
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.items()
Returns the value of theitems
record component.int
price()
Returns the value of theprice
record component.state()
Returns the value of thestate
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Constructor Details
-
Order
public Order(String _id, String customerEmail, int price, String type, String state, List<OrderItem> items) Creates an instance of aOrder
record class.- Parameters:
_id
- the value for the_id
record componentcustomerEmail
- the value for thecustomerEmail
record componentprice
- the value for theprice
record componenttype
- the value for thetype
record componentstate
- the value for thestate
record componentitems
- the value for theitems
record component
-
-
Method Details
-
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 '=='. -
_id
Returns the value of the_id
record component.- Returns:
- the value of the
_id
record component
-
customerEmail
Returns the value of thecustomerEmail
record component.- Returns:
- the value of the
customerEmail
record component
-
price
public int price()Returns the value of theprice
record component.- Returns:
- the value of the
price
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
state
Returns the value of thestate
record component.- Returns:
- the value of the
state
record component
-
items
Returns the value of theitems
record component.- Returns:
- the value of the
items
record component
-