Record Class TypedOptic<S,T,A,B>
java.lang.Object
java.lang.Record
com.mojang.datafixers.TypedOptic<S,T,A,B>
public record TypedOptic<S,T,A,B> (Set<com.google.common.reflect.TypeToken<? extends K1>> bounds, List<? extends TypedOptic.Element<?,?,?,?>> elements)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTypedOptic(com.google.common.reflect.TypeToken<? extends K1> proofBound, Type<S> sType, Type<T> tType, Type<A> aType, Type<B> bType, Optic<?, S, T, A, B> optic) TypedOptic(Set<com.google.common.reflect.TypeToken<? extends K1>> proofBounds, Type<S> sType, Type<T> tType, Type<A> aType, Type<B> bType, Optic<?, S, T, A, B> optic) TypedOptic(Set<com.google.common.reflect.TypeToken<? extends K1>> bounds, List<? extends TypedOptic.Element<?, ?, ?, ?>> elements) Creates an instance of aTypedOpticrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <S,T> TypedOptic <S, T, S, T> aType()bounds()Returns the value of theboundsrecord 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 theelementsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()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> private TypedOptic.Element<?, ?, A, B> static <Proof2 extends K1>
booleaninstanceOf(Collection<com.google.common.reflect.TypeToken<? extends K1>> bounds, com.google.common.reflect.TypeToken<Proof2> proof) static <A,B> TypedOptic <List<A>, List<B>, A, B> private TypedOptic.Element<S, T, ?, ?> 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> replaceTagged(TaggedChoice.TaggedChoiceType<K> sType, K key, Type<A> aType, Type<B> bType) 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()upCast(com.google.common.reflect.TypeToken<Proof2> proof)
-
Field Details
-
bounds
-
elements
The field for theelementsrecord component.
-
-
Constructor Details
-
TypedOptic
-
TypedOptic
-
TypedOptic
public TypedOptic(Set<com.google.common.reflect.TypeToken<? extends K1>> bounds, List<? extends TypedOptic.Element<?, ?, ?, ?>> elements) Creates an instance of aTypedOpticrecord class.- Parameters:
bounds- the value for theboundsrecord componentelements- the value for theelementsrecord component
-
-
Method Details
-
apply
-
outermost
-
innermost
-
outermostElement
-
innermostElement
-
sType
-
tType
-
aType
-
bType
-
compose
-
upCast
-
instanceOf
public static <Proof2 extends K1> boolean instanceOf(Collection<com.google.common.reflect.TypeToken<? extends K1>> bounds, com.google.common.reflect.TypeToken<Proof2> proof) -
adapter
-
proj1
-
proj2
-
inj1
-
inj2
-
compoundListKeys
-
compoundListElements
-
list
-
tagged
public static <K,A, TypedOptic<Pair<K,B> ?>, Pair<K, tagged?>, A, B> (TaggedChoice.TaggedChoiceType<K> sType, K key, Type<A> aType, Type<B> bType) -
replaceTagged
private static <K,A, Type<Pair<K,B> ?>> replaceTagged(TaggedChoice.TaggedChoiceType<K> sType, K key, Type<A> aType, Type<B> bType) -
castOuter
-
castOuterUnchecked
-
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). -
bounds
-
elements
Returns the value of theelementsrecord component.- Returns:
- the value of the
elementsrecord component
-