Record Class Item
java.lang.Object
java.lang.Record
de.chojo.universalis.entities.Item
- Record Components:
id- idname- name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Itembuild(NameSupplier nameSupplier, int id) Creates an item based on an id and retrieves the names vie the supplierbooleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.name()Returns the value of thenamerecord component.static ItemofId(int id) Create a new item by id with an empty namefinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Item
-
-
Method Details
-
build
Creates an item based on an id and retrieves the names vie the supplier- Parameters:
nameSupplier- name supplierid- item id- Returns:
- item
-
ofId
Create a new item by id with an empty name- Parameters:
id- id- Returns:
- new item instance
-
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 thecomparemethod from their corresponding wrapper classes. -
hashCode
-
toString
-
id
-
name
-