Package com.mojang.datafixers
Record Class TypedOptic<S,T,A,B>
java.lang.Object
java.lang.Record
com.mojang.datafixers.TypedOptic<S,T,A,B>
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionTypedOptic
(TypeToken<? extends K1> proofBound, Type<S> sType, Type<T> tType, Type<A> aType, Type<B> bType, Optic<?, S, T, A, B> optic) TypedOptic
(Set<TypeToken<? extends K1>> proofBounds, Type<S> sType, Type<T> tType, Type<A> aType, Type<B> bType, Optic<?, S, T, A, B> optic) TypedOptic
(Set<TypeToken<? extends K1>> bounds, List<? extends TypedOptic.Element<?, ?, ?, ?>> elements) Creates an instance of aTypedOptic
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <S,
T> TypedOptic<S, T, S, T> aType()
bounds()
Returns the value of thebounds
record component.bType()
TypedOptic<S,
T, A, B> <S2,
T2> TypedOptic<S2, T2, A, B> castOuterUnchecked
(Type<S2> sType, Type<T2> tType) <A1,
B1> TypedOptic<S, T, A1, B1> compose
(TypedOptic<A, B, A1, B1> other) static <K,
V, V2> TypedOptic<List<Pair<K, V>>, List<Pair<K, V2>>, V, V2> compoundListElements
(Type<K> keyType, Type<V> aType, Type<V2> bType) static <K,
V, K2> TypedOptic<List<Pair<K, V>>, List<Pair<K2, V>>, K, K2> compoundListKeys
(Type<K> aType, Type<K2> bType, Type<V> valueType) List<? extends TypedOptic.Element<?,
?, ?, ?>> elements()
Returns the value of theelements
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static <F,
G, F2> TypedOptic<Either<F, G>, Either<F2, G>, F, F2> static <F,
G, G2> TypedOptic<Either<F, G>, Either<F, G2>, G, G2> static <Proof2 extends K1>
booleaninstanceOf
(Collection<TypeToken<? extends K1>> bounds, TypeToken<Proof2> proof) static <A,
B> TypedOptic<List<A>, List<B>, A, B> static <F,
G, F2> TypedOptic<Pair<F, G>, Pair<F2, G>, F, F2> static <F,
G, G2> TypedOptic<Pair<F, G>, Pair<F, G2>, G, G2> sType()
static <K,
A, B> TypedOptic<Pair<K, ?>, Pair<K, ?>, A, B> tagged
(TaggedChoice.TaggedChoiceType<K> sType, K key, Type<A> aType, Type<B> bType) toString()
Returns a string representation of this record class.tType()
-
Constructor Details
-
TypedOptic
-
TypedOptic
-
TypedOptic
public TypedOptic(Set<TypeToken<? extends K1>> bounds, List<? extends TypedOptic.Element<?, ?, ?, ?>> elements) Creates an instance of aTypedOptic
record class.- Parameters:
bounds
- the value for thebounds
record componentelements
- the value for theelements
record component
-
-
Method Details
-
apply
-
outermost
-
innermost
-
sType
-
tType
-
aType
-
bType
-
compose
-
upCast
-
instanceOf
public static <Proof2 extends K1> boolean instanceOf(Collection<TypeToken<? extends K1>> bounds, TypeToken<Proof2> proof) -
adapter
-
proj1
-
proj2
-
inj1
-
inj2
-
compoundListKeys
-
compoundListElements
-
list
-
tagged
public static <K,A, TypedOptic<Pair<K,B> ?>, taggedPair<K, ?>, A, B> (TaggedChoice.TaggedChoiceType<K> sType, K key, Type<A> aType, Type<B> bType) -
castOuter
-
castOuterUnchecked
-
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)
. -
bounds
Returns the value of thebounds
record component.- Returns:
- the value of the
bounds
record component
-
elements
Returns the value of theelements
record component.- Returns:
- the value of the
elements
record component
-