Package me.hsgamer.topper.value.core
Class ValueWrapper<T>
java.lang.Object
me.hsgamer.topper.value.core.ValueWrapper<T>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal @NotNull Stringfinal @NotNull ValueWrapper.Statefinal @Nullable Throwablefinal T -
Constructor Summary
ConstructorsConstructorDescriptionValueWrapper(@NotNull ValueWrapper.State state, T value, @NotNull String errorMessage, @Nullable Throwable throwable) -
Method Summary
Modifier and TypeMethodDescriptionasOptional(BiConsumer<@NotNull String, @Nullable Throwable> errorConsumer) static <T> ValueWrapper<T> copyNullWrapper(@NotNull ValueWrapper<?> wrapper) static <T> ValueWrapper<T> static <T> ValueWrapper<T> static <T> ValueWrapper<T> static <T> ValueWrapper<T> handled(T value) booleanbooleanisNull()static <T> ValueWrapper<T>
-
Field Details
-
state
-
value
-
errorMessage
-
throwable
-
-
Constructor Details
-
ValueWrapper
public ValueWrapper(@NotNull @NotNull ValueWrapper.State state, @Nullable T value, @NotNull @NotNull String errorMessage, @Nullable @Nullable Throwable throwable)
-
-
Method Details
-
handled
-
notHandled
-
error
-
error
-
error
public static <T> ValueWrapper<T> error(@NotNull @NotNull String errorMessage, @NotNull @NotNull Throwable throwable) -
copyNullWrapper
-
isHandled
public boolean isHandled() -
isNull
public boolean isNull() -
asOptional
-
asOptional
-