All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.yudichev.jiotty.appliance.BaseCommandMeta Maven / Gradle / Ivy

package net.yudichev.jiotty.appliance;

import com.google.common.collect.ImmutableMap;
import net.yudichev.jiotty.common.lang.PublicImmutablesStyle;
import org.immutables.value.Value;

import java.util.Map;
import java.util.function.Function;

import static org.immutables.value.Value.Immutable;

@Immutable
@PublicImmutablesStyle
abstract class BaseCommandMeta> {
    public abstract String commandName();

    @Value.Default
    public Map parameterTypes() {
        return ImmutableMap.of();
    }

    public abstract Function, T> commandFactory();

    public final T createCommand(Map parameters) {
        return commandFactory().apply(parameters);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy