Package com.mojang.datafixers.types
Class Type<A>
java.lang.Object
com.mojang.datafixers.types.Type<A>
- Direct Known Subclasses:
Check.CheckType
,CompoundList.CompoundListType
,Const.PrimitiveType
,EmptyPart
,EmptyPartPassthrough
,Func
,Hook.HookType
,List.ListType
,Named.NamedType
,Product.ProductType
,RecursivePoint.RecursivePointType
,Sum.SumType
,Tag.TagType
,TaggedChoice.TaggedChoiceType
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static class
static class
static class
static interface
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRewriteResult<A,
?> all
(TypeRewriteRule rule, boolean recurse, boolean checkIndex) abstract TypeTemplate
codec()
final boolean
abstract boolean
Optional<RewriteResult<A,
?>> everywhere
(TypeRewriteRule rule, PointFreeRule optimizationRule, boolean recurse, boolean checkIndex) findCheckedType
(int index) findChoiceType
(String name, int index) finder()
OpticFinder<?>
Type<?>
findFieldType
(String name) findFieldTypeOpt
(String name) <FT,
FR> Either<TypedOptic<A, ?, FT, FR>, Type.FieldNotFoundException> findType
(Type<FT> type, Type<FR> resultType, Type.TypeMatcher<FT, FR> matcher, boolean recurse) <FT,
FR> Either<TypedOptic<A, ?, FT, FR>, Type.FieldNotFoundException> findTypeCached
(Type<FT> type, Type<FR> resultType, Type.TypeMatcher<FT, FR> matcher, boolean recurse) <FT,
FR> Either<TypedOptic<A, ?, FT, FR>, Type.FieldNotFoundException> findTypeInChildren
(Type<FT> type, Type<FR> resultType, Type.TypeMatcher<FT, FR> matcher, boolean recurse) <FT,
FR> Type<?> getSetType
(OpticFinder<FT> optic, Type<FR> newType) <B> Optional<RewriteResult<A,
?>> ifSame
(Type<B> type, RewriteResult<B, ?> value) Optional<RewriteResult<A,
?>> one
(TypeRewriteRule rule) static <S,
T, A, B> RewriteResult<S, T> opticView
(Type<S> type, RewriteResult<A, B> view, TypedOptic<S, T, A, B> optic) point
(DynamicOps<?> ops) pointTyped
(DynamicOps<?> ops) final <T> DataResult<Pair<A,
Dynamic<T>>> <T> DataResult<Pair<Optional<?>,
T>> read
(DynamicOps<T> ops, TypeRewriteRule rule, PointFreeRule fRule, T input) <T> DataResult<T>
readAndWrite
(DynamicOps<T> ops, Type<?> expectedType, TypeRewriteRule rule, PointFreeRule fRule, T input) <T> DataResult<Pair<Typed<A>,
T>> <T> DataResult<Pair<Typed<A>,
T>> readTyped
(DynamicOps<T> ops, T input) Optional<RewriteResult<A,
?>> rewrite
(TypeRewriteRule rule, PointFreeRule fRule) RewriteResult<A,
?> rewriteOrNop
(TypeRewriteRule rule) template()
static <A> Type<A>
Type<?>
updateMu
(RecursiveTypeFamily newFamily) final <T> DataResult<T>
write
(DynamicOps<T> ops, A value) final <T> DataResult<Dynamic<T>>
writeDynamic
(DynamicOps<T> ops, A value)
-
Constructor Details
-
Type
public Type()
-
-
Method Details
-
unbox
-
rewriteOrNop
-
opticView
public static <S,T, RewriteResult<S,A, B> T> opticView(Type<S> type, RewriteResult<A, B> view, TypedOptic<S, T, A, B> optic) -
all
- Mojang-Added Docs:
gmapT
run rule on all direct children and combine results
-
one
- Mojang-Added Docs:
run rule on exactly one child
-
everywhere
public Optional<RewriteResult<A,?>> everywhere(TypeRewriteRule rule, PointFreeRule optimizationRule, boolean recurse, boolean checkIndex) -
updateMu
-
template
-
buildTemplate
-
findChoiceType
-
findCheckedType
-
read
-
codec
-
buildCodec
-
write
-
writeDynamic
-
readTyped
-
readTyped
-
read
public <T> DataResult<Pair<Optional<?>,T>> read(DynamicOps<T> ops, TypeRewriteRule rule, PointFreeRule fRule, T input) -
readAndWrite
public <T> DataResult<T> readAndWrite(DynamicOps<T> ops, Type<?> expectedType, TypeRewriteRule rule, PointFreeRule fRule, T input) -
rewrite
-
getSetType
-
findFieldTypeOpt
-
findFieldType
-
findField
-
point
- Mojang-Added Docs:
populate with the default value, if possible
only initializes empty things
-
pointTyped
-
findTypeCached
public <FT,FR> Either<TypedOptic<A,?, findTypeCachedFT, FR>, Type.FieldNotFoundException> (Type<FT> type, Type<FR> resultType, Type.TypeMatcher<FT, FR> matcher, boolean recurse) -
findType
public <FT,FR> Either<TypedOptic<A,?, findTypeFT, FR>, Type.FieldNotFoundException> (Type<FT> type, Type<FR> resultType, Type.TypeMatcher<FT, FR> matcher, boolean recurse) -
findTypeInChildren
public <FT,FR> Either<TypedOptic<A,?, findTypeInChildrenFT, FR>, Type.FieldNotFoundException> (Type<FT> type, Type<FR> resultType, Type.TypeMatcher<FT, FR> matcher, boolean recurse) -
finder
-
ifSame
-
ifSame
-
ifSame
-
equals
-
equals
-