io.github.amayaframework.options.ProvidedGroupSet Maven / Gradle / Ivy
The newest version!
package io.github.amayaframework.options;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.function.Supplier;
/**
* Implementation of {@link GroupOptionSet} that automatically creates
* requested group instance on {@link GroupOptionSet#set(String, Object)} operation.
*/
public class ProvidedGroupSet extends AbstractGroupSet {
private final Function provider;
/**
* Constructs {@link ProvidedGroupSet} instance with given delimiter, default group name, map provided by supplier
* and group instance provider.
*
* @param delimiter the specified delimiter
* @param defGroup the specified default group name
* @param supplier supplier providing map instance
* @param provider function providing group instance
*/
public ProvidedGroupSet(String delimiter,
String defGroup,
Supplier