Record Class DataResult.Error<R>
java.lang.Object
java.lang.Record
com.mojang.serialization.DataResult.Error<R>
- All Implemented Interfaces:
App<DataResult.Mu, R>, DataResult<R>
- Enclosing interface:
DataResult<R>
-
Nested Class Summary
Nested classes/interfaces inherited from interface DataResult
DataResult.Error<R>, DataResult.Instance, DataResult.Mu, DataResult.Success<R> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LifecycleThe field for thelifecyclerecord component.The field for themessageSupplierrecord component.The field for thepartialValuerecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R2> DataResult.Error<R2> ap(DataResult<Function<R, R2>> functionResult) final booleanIndicates whether some other object is "equal to" this one.error()<R2> DataResult.Error<R2> flatMap(Function<? super R, ? extends DataResult<R2>> function) Applies the function to either full or partial result, in case of partial concatenates errors.getOrThrow(Function<String, E> exceptionSupplier) getPartialOrThrow(Function<String, E> exceptionSupplier) final inthashCode()Returns a hash code value for this object.booleanifError(Consumer<? super DataResult.Error<R>> ifError) booleanReturns the value of thelifecyclerecord component.<T> DataResult.Error<T> mapError(UnaryOperator<String> function) <T> TmapOrElse(Function<? super R, ? extends T> successFunction, Function<? super DataResult.Error<R>, ? extends T> errorFunction) message()Returns the value of themessageSupplierrecord component.Returns the value of thepartialValuerecord component.promotePartial(Consumer<String> onError) result()resultOrPartial(Consumer<String> onError) setLifecycle(Lifecycle lifecycle) setPartial(Supplier<R> partial) setPartial(R partial) toString()Returns a string representation of this record class.Methods inherited from interface DataResult
addLifecycle, apply2, apply2stable, apply3, getOrThrow, getPartialOrThrow, isError
-
Field Details
-
messageSupplier
-
partialValue
-
lifecycle
The field for thelifecyclerecord component.
-
-
Constructor Details
-
Error
Creates an instance of aErrorrecord class.- Parameters:
messageSupplier- the value for themessageSupplierrecord componentpartialValue- the value for thepartialValuerecord componentlifecycle- the value for thelifecyclerecord component
-
-
Method Details
-
message
-
result
- Specified by:
resultin interfaceDataResult<R>
-
error
- Specified by:
errorin interfaceDataResult<R>
-
hasResultOrPartial
public boolean hasResultOrPartial()- Specified by:
hasResultOrPartialin interfaceDataResult<R>
-
resultOrPartial
- Specified by:
resultOrPartialin interfaceDataResult<R>
-
resultOrPartial
- Specified by:
resultOrPartialin interfaceDataResult<R>
-
getOrThrow
- Specified by:
getOrThrowin interfaceDataResult<R>- Throws:
E
-
getPartialOrThrow
- Specified by:
getPartialOrThrowin interfaceDataResult<R>- Throws:
E
-
map
- Specified by:
mapin interfaceDataResult<R>
-
mapOrElse
public <T> T mapOrElse(Function<? super R, ? extends T> successFunction, Function<? super DataResult.Error<R>, ? extends T> errorFunction) - Specified by:
mapOrElsein interfaceDataResult<R>
-
ifSuccess
- Specified by:
ifSuccessin interfaceDataResult<R>
-
ifError
- Specified by:
ifErrorin interfaceDataResult<R>
-
promotePartial
- Specified by:
promotePartialin interfaceDataResult<R>
-
flatMap
Description copied from interface:DataResultApplies the function to either full or partial result, in case of partial concatenates errors.- Specified by:
flatMapin interfaceDataResult<R>
-
ap
- Specified by:
apin interfaceDataResult<R>
-
setPartial
- Specified by:
setPartialin interfaceDataResult<R>
-
setPartial
- Specified by:
setPartialin interfaceDataResult<R>
-
mapError
- Specified by:
mapErrorin interfaceDataResult<R>
-
setLifecycle
- Specified by:
setLifecyclein interfaceDataResult<R>
-
isSuccess
public boolean isSuccess()- Specified by:
isSuccessin interfaceDataResult<R>
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
messageSupplier
-
partialValue
-
lifecycle
Returns the value of thelifecyclerecord component.- Specified by:
lifecyclein interfaceDataResult<R>- Returns:
- the value of the
lifecyclerecord component
-