public final class Typed<A> extends Object
Modifier and Type | Field and Description |
---|---|
protected DynamicOps<?> |
ops |
protected Type<A> |
type |
protected A |
value |
Constructor and Description |
---|
Typed(Type<A> type,
DynamicOps<?> ops,
A value) |
Modifier and Type | Method and Description |
---|---|
<FT> FT |
get(OpticFinder<FT> optic) |
<FT> List<FT> |
getAll(TypedOptic<A,?,FT,?> field) |
<FT> List<Typed<FT>> |
getAllTyped(OpticFinder<FT> optic) |
DynamicOps<?> |
getOps() |
<FT> Optional<FT> |
getOptional(OpticFinder<FT> optic) |
<FT> Optional<Typed<FT>> |
getOptionalTyped(OpticFinder<FT> optic) |
<FT> FT |
getOrCreate(OpticFinder<FT> optic) |
<FT> Typed<FT> |
getOrCreateTyped(OpticFinder<FT> optic) |
<FT> FT |
getOrDefault(OpticFinder<FT> optic,
FT def) |
Type<A> |
getType() |
<FT> Typed<FT> |
getTyped(OpticFinder<FT> optic) |
A |
getValue() |
<B> Typed<(A|B)> |
inj1(Type<B> type) |
<B> Typed<(B|A)> |
inj2(Type<B> type) |
Typed<A> |
out() |
static <A,B> Typed<(A,B)> |
pair(Typed<A> first,
Typed<B> second) |
<FT> Typed<?> |
set(OpticFinder<FT> optic,
FT newValue) |
<FT,FR> Typed<?> |
set(OpticFinder<FT> optic,
Type<FR> newType,
FR newValue) |
<FT,FR> Typed<?> |
set(OpticFinder<FT> optic,
Typed<FR> newValue) |
String |
toString() |
<FT> Typed<?> |
update(OpticFinder<FT> optic,
(FT) -> FT updater) |
<FT,FR> Typed<?> |
update(OpticFinder<FT> optic,
Type<FR> newType,
(FT) -> FR updater) |
<FT> Typed<?> |
updateRecursive(OpticFinder<FT> optic,
(FT) -> FT updater) |
<FT,FR> Typed<?> |
updateRecursive(OpticFinder<FT> optic,
Type<FR> newType,
(FT) -> FR updater) |
<FT> Typed<?> |
updateRecursiveTyped(OpticFinder<FT> optic,
(Typed<?>) -> Typed<?> updater) |
<FT,FR> Typed<?> |
updateRecursiveTyped(OpticFinder<FT> optic,
Type<FR> newType,
(Typed<?>) -> Typed<?> updater) |
<FT> Typed<?> |
updateTyped(OpticFinder<FT> optic,
(Typed<?>) -> Typed<?> updater) |
<FT,FR> Typed<?> |
updateTyped(OpticFinder<FT> optic,
Type<FR> newType,
(Typed<?>) -> Typed<?> updater) |
DataResult<? extends Dynamic<?>> |
write() |
protected final DynamicOps<?> ops
protected final A value
public Typed(Type<A> type, DynamicOps<?> ops, A value)
public <FT> FT get(OpticFinder<FT> optic)
public <FT> Typed<FT> getTyped(OpticFinder<FT> optic)
public <FT> Optional<FT> getOptional(OpticFinder<FT> optic)
public <FT> FT getOrCreate(OpticFinder<FT> optic)
public <FT> FT getOrDefault(OpticFinder<FT> optic, FT def)
public <FT> Optional<Typed<FT>> getOptionalTyped(OpticFinder<FT> optic)
public <FT> Typed<FT> getOrCreateTyped(OpticFinder<FT> optic)
public <FT> Typed<?> set(OpticFinder<FT> optic, FT newValue)
public <FT,FR> Typed<?> set(OpticFinder<FT> optic, Type<FR> newType, FR newValue)
public <FT,FR> Typed<?> set(OpticFinder<FT> optic, Typed<FR> newValue)
public <FT> Typed<?> updateTyped(OpticFinder<FT> optic, (Typed<?>) -> Typed<?> updater)
public <FT,FR> Typed<?> updateTyped(OpticFinder<FT> optic, Type<FR> newType, (Typed<?>) -> Typed<?> updater)
public <FT> Typed<?> update(OpticFinder<FT> optic, (FT) -> FT updater)
public <FT,FR> Typed<?> update(OpticFinder<FT> optic, Type<FR> newType, (FT) -> FR updater)
public <FT> Typed<?> updateRecursiveTyped(OpticFinder<FT> optic, (Typed<?>) -> Typed<?> updater)
public <FT,FR> Typed<?> updateRecursiveTyped(OpticFinder<FT> optic, Type<FR> newType, (Typed<?>) -> Typed<?> updater)
public <FT> Typed<?> updateRecursive(OpticFinder<FT> optic, (FT) -> FT updater)
public <FT,FR> Typed<?> updateRecursive(OpticFinder<FT> optic, Type<FR> newType, (FT) -> FR updater)
public <FT> List<Typed<FT>> getAllTyped(OpticFinder<FT> optic)
public <FT> List<FT> getAll(TypedOptic<A,?,FT,?> field)
public DynamicOps<?> getOps()
public A getValue()
public DataResult<? extends Dynamic<?>> write()