Package appeng.api.storage
Record Class LinkStatus
java.lang.Object
java.lang.Record
appeng.api.storage.LinkStatus
- All Implemented Interfaces:
ILinkStatus
public record LinkStatus(boolean connected, @Nullable net.minecraft.network.chat.Component statusDescription)
extends Record
implements ILinkStatus
-
Constructor Summary
ConstructorsConstructorDescriptionLinkStatus
(boolean connected, @Nullable net.minecraft.network.chat.Component statusDescription) Creates an instance of aLinkStatus
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of theconnected
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.@Nullable net.minecraft.network.chat.Component
Returns the value of thestatusDescription
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
LinkStatus
public LinkStatus(boolean connected, @Nullable @Nullable net.minecraft.network.chat.Component statusDescription) Creates an instance of aLinkStatus
record class.- Parameters:
connected
- the value for theconnected
record componentstatusDescription
- the value for thestatusDescription
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 '=='. -
connected
public boolean connected()Returns the value of theconnected
record component.- Specified by:
connected
in interfaceILinkStatus
- Returns:
- the value of the
connected
record component
-
statusDescription
@Nullable public @Nullable net.minecraft.network.chat.Component statusDescription()Returns the value of thestatusDescription
record component.- Specified by:
statusDescription
in interfaceILinkStatus
- Returns:
- the value of the
statusDescription
record component
-