Package net.minecraft.server.level
Record Class ChunkResult.Fail<T>
java.lang.Object
java.lang.Record
net.minecraft.server.level.ChunkResult.Fail<T>
- All Implemented Interfaces:
ChunkResult<T>
- Enclosing interface:
ChunkResult<T>
public static record ChunkResult.Fail<T>(Supplier<String> error)
extends Record
implements ChunkResult<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.server.level.ChunkResult
ChunkResult.Fail<T>, ChunkResult.Success<T>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.error()
Returns the value of theerror
record component.getError()
final int
hashCode()
Returns a hash code value for this object.boolean
<R> ChunkResult
<R> orElseThrow
(Supplier<E> p_331373_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
error
The field for theerror
record component.
-
-
Constructor Details
-
Fail
Creates an instance of aFail
record class.- Parameters:
error
- the value for theerror
record component
-
-
Method Details
-
isSuccess
public boolean isSuccess()- Specified by:
isSuccess
in interfaceChunkResult<T>
-
orElse
- Specified by:
orElse
in interfaceChunkResult<T>
-
getError
- Specified by:
getError
in interfaceChunkResult<T>
-
ifSuccess
- Specified by:
ifSuccess
in interfaceChunkResult<T>
-
map
- Specified by:
map
in interfaceChunkResult<T>
-
orElseThrow
- Specified by:
orElseThrow
in interfaceChunkResult<T>
- Throws:
E
-
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)
. -
error
Returns the value of theerror
record component.- Returns:
- the value of the
error
record component
-