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
Constructors -
Method Summary
Modifier and TypeMethodDescription_id()Returns the value of the_idrecord component.Returns the value of thecustomerEmailrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.items()Returns the value of theitemsrecord component.intprice()Returns the value of thepricerecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Order
public Order(String _id, String customerEmail, int price, String type, String state, List<OrderItem> items) Creates an instance of aOrderrecord class.- Parameters:
_id- the value for the_idrecord componentcustomerEmail- the value for thecustomerEmailrecord componentprice- the value for thepricerecord componenttype- the value for thetyperecord componentstate- the value for thestaterecord componentitems- the value for theitemsrecord 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_idrecord component.- Returns:
- the value of the
_idrecord component
-
customerEmail
Returns the value of thecustomerEmailrecord component.- Returns:
- the value of the
customerEmailrecord component
-
price
public int price()Returns the value of thepricerecord component.- Returns:
- the value of the
pricerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
items
Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-