Interface TypeTemplate

All Known Implementing Classes:
Check, CompoundList, Const, Hook, List, Named, Product, RecursivePoint, Sum, Tag, TaggedChoice

public interface TypeTemplate
  • Method Details

    • size

      int size()
    • apply

      TypeFamily apply(TypeFamily family)
    • toSimpleType

      default Type<?> toSimpleType()
    • findFieldOrType

      <A, B> Either<TypeTemplate,Type.FieldNotFoundException> findFieldOrType(int index, @Nullable String name, Type<A> type, Type<B> resultType)
      Mojang-Added Docs:

      returned optic will accept template<family<index>> with the input template, and will return the same with the returned template
      (template, optic) = Left(result)
      this.apply(family).apply(index) == optic.sType
      template.apply(family).apply(index) == optic.tType

    • hmap

      IntFunction<RewriteResult<?,?>> hmap(TypeFamily family, IntFunction<RewriteResult<?,?>> function)
      Mojang-Added Docs:

      constraint: family, argFamily and resFamily are matched
      result.function(i) :: this.apply(function.argFamily()).apply(i) -> this.apply(function.resFamily()).apply(i)

    • applyO

      <A, B> FamilyOptic<A,B> applyO(FamilyOptic<A,B> input, Type<A> aType, Type<B> bType)