Interface Builder<T,B extends Builder<T,B>>

Type Parameters:
T - the type of value stored by the builder
B - the specific builder type extending this interface
All Superinterfaces:
BaseBuilder<B>
All Known Implementing Classes:
ButtonBuilder, ChestBuilder, GuiBuilder, PaneBuilder

public interface Builder<T,B extends Builder<T,B>> extends BaseBuilder<B>
Represents a builder that holds a single value of type T and allows modifications.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the stored value.
    default B
    modify(Consumer<T> consumer)
    Modifies the stored value using the provided consumer function.

    Methods inherited from interface me.croabeast.common.builder.BaseBuilder

    instance
  • Method Details

    • getValue

      T getValue()
      Retrieves the stored value.
      Returns:
      the current value
    • modify

      default B modify(Consumer<T> consumer)
      Modifies the stored value using the provided consumer function.
      Parameters:
      consumer - the function to modify the value
      Returns:
      the builder instance for fluent method calls
      Throws:
      NullPointerException - if the consumer is null