Record Class StorageView
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.transfer.StorageView
- Record Components:
variant- what the slot holds, ornullif it is emptyamount- how much it holdscapacity- how much it can hold
public record StorageView(@Nullable ResourceVariant variant, long amount, long capacity)
extends Record
A read-only snapshot of one storage slot.
-
Constructor Summary
ConstructorsConstructorDescriptionStorageView(@Nullable ResourceVariant variant, long amount, long capacity) Creates an instance of aStorageViewrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongamount()Returns the value of theamountrecord component.longcapacity()Returns the value of thecapacityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()final StringtoString()Returns a string representation of this record class.@Nullable ResourceVariantvariant()Returns the value of thevariantrecord component.
-
Constructor Details
-
Method Details
-
isEmpty
public boolean isEmpty() -
toString
-
hashCode
-
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. -
variant
-
amount
-
capacity
-