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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.getError()final inthashCode()Returns a hash code value for this object.boolean<R> ChunkResult<R> orElseThrow(Supplier<E> p_331734_) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
error
The field for theerrorrecord component.
-
-
Constructor Details
-
Fail
Creates an instance of aFailrecord class.- Parameters:
error- the value for theerrorrecord component
-
-
Method Details
-
isSuccess
public boolean isSuccess()- Specified by:
isSuccessin interfaceChunkResult<T>
-
orElse
- Specified by:
orElsein interfaceChunkResult<T>
-
getError
- Specified by:
getErrorin interfaceChunkResult<T>
-
ifSuccess
- Specified by:
ifSuccessin interfaceChunkResult<T>
-
map
- Specified by:
mapin interfaceChunkResult<T>
-
orElseThrow
- Specified by:
orElseThrowin 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 theerrorrecord component.- Returns:
- the value of the
errorrecord component
-