Class FunctionalMassBuilder<I,O>

java.lang.Object
me.hsgamer.hscore.builder.MassBuilder<I,O>
me.hsgamer.hscore.builder.FunctionalMassBuilder<I,O>
Type Parameters:
I - the type of the input
O - the type of the output
Direct Known Subclasses:
ActionBuilder

public abstract class FunctionalMassBuilder<I,O> extends MassBuilder<I,O>
The mass builder for the functional value. This is useful for builders where the input contains a type and the type is used to determine the creator.
  • Constructor Details

    • FunctionalMassBuilder

      public FunctionalMassBuilder()
  • Method Details

    • getType

      protected abstract String getType(I input)
    • register

      public void register(Function<I,O> creator, String... type)
      Register a new creator
      Parameters:
      creator - the creator
      type - the type
    • build

      public List<O> build(List<I> list, Function<I,O> defaultValueFunction)
      Build the value from the input
      Parameters:
      list - the input
      defaultValueFunction - the default value function
      Returns:
      the value