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 aLinkStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theconnectedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable net.minecraft.network.chat.ComponentReturns the value of thestatusDescriptionrecord component.final StringtoString()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 aLinkStatusrecord class.- Parameters:
connected- the value for theconnectedrecord componentstatusDescription- the value for thestatusDescriptionrecord 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 theconnectedrecord component.- Specified by:
connectedin interfaceILinkStatus- Returns:
- the value of the
connectedrecord component
-
statusDescription
@Nullable public @Nullable net.minecraft.network.chat.Component statusDescription()Returns the value of thestatusDescriptionrecord component.- Specified by:
statusDescriptionin interfaceILinkStatus- Returns:
- the value of the
statusDescriptionrecord component
-