Interface RecipeOptional<T>

All Known Subinterfaces:
RecipeOptional.Unit<T>
All Known Implementing Classes:
RecipeOptional.Constant, RecipeOptional.Unit.Impl
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RecipeOptional<T>
  • Field Details

  • Method Details

    • getDefaultValue

      T getDefaultValue(RecipeSchemaType type)
    • getInformativeValue

      @Nullable default T getInformativeValue()
      Gets a value that is used during data generation of recipe schema JSONs, as well as during debugging of recipe constructors.

      This needs to be implemented if you intend to use data generation with a custom optional type

    • isDefault

      default boolean isDefault()
    • unit

      static <T> RecipeOptional<T> unit(@Nullable T value)