Record Class MachineError.InsufficientResource
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.error.MachineError.InsufficientResource
- All Implemented Interfaces:
MachineError
- Enclosing interface:
MachineError
public static record MachineError.InsufficientResource(@NotNull net.kyori.adventure.key.Key resource, long required, long available)
extends Record
implements MachineError
Less than required was available.
-
Nested Class Summary
Nested classes/interfaces inherited from interface MachineError
MachineError.Generic, MachineError.InsufficientResource, MachineError.InvalidConfiguration, MachineError.InvalidDefinition, MachineError.MissingResource, MachineError.SerializationError, MachineError.TransferRejected, MachineError.WrongThread -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInsufficientResource(@NotNull net.kyori.adventure.key.Key resource, long required, long available) Creates an instance of aInsufficientResourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theavailablerecord component.@NotNull net.kyori.adventure.key.Keycode()Stable machine-readable code, e.g.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Stringmessage()longrequired()Returns the value of therequiredrecord component.@NotNull net.kyori.adventure.key.Keyresource()Returns the value of theresourcerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface MachineError
context, format
-
Field Details
-
CODE
public static final net.kyori.adventure.key.Key CODE
-
-
Constructor Details
-
InsufficientResource
public InsufficientResource(@NotNull @NotNull net.kyori.adventure.key.Key resource, long required, long available) Creates an instance of aInsufficientResourcerecord class.- Parameters:
resource- the value for theresourcerecord componentrequired- the value for therequiredrecord componentavailable- the value for theavailablerecord component
-
-
Method Details
-
code
@NotNull public @NotNull net.kyori.adventure.key.Key code()Description copied from interface:MachineErrorStable machine-readable code, e.g.machineengine:insufficient_resource.- Specified by:
codein interfaceMachineError
-
message
- Specified by:
messagein interfaceMachineError
-
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. -
resource
@NotNull public @NotNull net.kyori.adventure.key.Key resource()Returns the value of theresourcerecord component.- Returns:
- the value of the
resourcerecord component
-
required
public long required()Returns the value of therequiredrecord component.- Returns:
- the value of the
requiredrecord component
-
available
public long available()Returns the value of theavailablerecord component.- Returns:
- the value of the
availablerecord component
-