Record Class PreviewItem
java.lang.Object
java.lang.Record
com.refinedmods.refinedstorage.api.autocrafting.preview.PreviewItem
@API(status=STABLE,
since="2.0.0-milestone.4.9")
public record PreviewItem(ResourceKey resource, long available, long missing, long toCraft)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPreviewItem
(ResourceKey resource, long available, long missing, long toCraft) Creates an instance of aPreviewItem
record class. -
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the value of theavailable
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.long
missing()
Returns the value of themissing
record component.resource()
Returns the value of theresource
record component.long
toCraft()
Returns the value of thetoCraft
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
PreviewItem
Creates an instance of aPreviewItem
record class.- Parameters:
resource
- the value for theresource
record componentavailable
- the value for theavailable
record componentmissing
- the value for themissing
record componenttoCraft
- the value for thetoCraft
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 '=='. -
resource
Returns the value of theresource
record component.- Returns:
- the value of the
resource
record component
-
available
public long available()Returns the value of theavailable
record component.- Returns:
- the value of the
available
record component
-
missing
public long missing()Returns the value of themissing
record component.- Returns:
- the value of the
missing
record component
-
toCraft
public long toCraft()Returns the value of thetoCraft
record component.- Returns:
- the value of the
toCraft
record component
-