package dev.isxander.yacl3.impl.controller; import com.google.common.collect.ImmutableList; import dev.isxander.yacl3.api.Controller; import dev.isxander.yacl3.api.Option; import dev.isxander.yacl3.api.controller.CyclingListControllerBuilder; import dev.isxander.yacl3.api.controller.ValueFormatter; import dev.isxander.yacl3.gui.controllers.cycling.CyclingListController; public final class CyclingListControllerBuilderImpl extends AbstractControllerBuilderImpl implements CyclingListControllerBuilder { private Iterable values; private ValueFormatter formatter = null; public CyclingListControllerBuilderImpl(Option option) { super(option); } @Override public CyclingListControllerBuilder values(Iterable values) { this.values = values; return this; } @SafeVarargs @Override public final CyclingListControllerBuilder values(T... values) { this.values = ImmutableList.copyOf(values); return this; } @Override public CyclingListControllerBuilder formatValue(ValueFormatter formatter) { this.formatter = formatter; return this; } @Override public Controller build() { return CyclingListController.createInternal(option, values, formatter); } }