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

org.jvirtanen.philadelphia.client.command.Commands Maven / Gradle / Ivy

The newest version!
package org.jvirtanen.philadelphia.client.command;

import org.eclipse.collections.api.list.ImmutableList;
import org.eclipse.collections.impl.factory.Lists;

public class Commands {

    private static final ImmutableList COMMANDS = Lists.immutable.of(
            new SendCommand(),
            new MessagesCommand(),
            new HelpCommand(),
            new ExitCommand()
        );

    private Commands() {
    }

    public static ImmutableList all() {
        return COMMANDS;
    }

    public static Command find(final String name) {
        return COMMANDS.select(c -> c.getName().equals(name)).getFirst();
    }

    public static ImmutableList names() {
        return COMMANDS.collect(c -> c.getName());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy