Package net.neoforged.neoforge.items
Record Class ContainerOrHandler
java.lang.Object
java.lang.Record
net.neoforged.neoforge.items.ContainerOrHandler
public record ContainerOrHandler(@Nullable Container container, @Nullable IItemHandler itemHandler)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable ContainerThe field for thecontainerrecord component.static final ContainerOrHandlerprivate final @Nullable IItemHandlerThe field for theitemHandlerrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionContainerOrHandler(@Nullable Container container, @Nullable IItemHandler itemHandler) Creates an instance of aContainerOrHandlerrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable ContainerReturns the value of thecontainerrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()@Nullable IItemHandlerReturns the value of theitemHandlerrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
container
The field for thecontainerrecord component. -
itemHandler
The field for theitemHandlerrecord component. -
EMPTY
-
-
Constructor Details
-
ContainerOrHandler
public ContainerOrHandler(@Nullable @Nullable Container container, @Nullable @Nullable IItemHandler itemHandler) Creates an instance of aContainerOrHandlerrecord class.- Parameters:
container- the value for thecontainerrecord componentitemHandler- the value for theitemHandlerrecord component
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
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. All components in this record class are compared withObjects::equals(Object,Object). -
container
Returns the value of thecontainerrecord component.- Returns:
- the value of the
containerrecord component
-
itemHandler
Returns the value of theitemHandlerrecord component.- Returns:
- the value of the
itemHandlerrecord component
-