Interface RecipeOptional<T>

All Known Implementing Classes:
RecipeOptional.Constant
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()
    • getValueForDataGeneration

      default T getValueForDataGeneration()
      Gets a value that can be encoded into json by a recipe key's codec. For use in data generation

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

    • isDefault

      default boolean isDefault()