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

org.seedstack.seed.cli.internal.CommandLineHandlerSpecification Maven / Gradle / Ivy

The newest version!
/*
 * Copyright © 2013-2024, The SeedStack authors 
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package org.seedstack.seed.cli.internal;

import java.lang.reflect.Modifier;
import java.util.function.Predicate;
import org.seedstack.seed.cli.CommandLineHandler;
import org.seedstack.shed.reflect.ClassPredicates;

class CommandLineHandlerSpecification implements Predicate> {
    static CommandLineHandlerSpecification INSTANCE = new CommandLineHandlerSpecification();

    private CommandLineHandlerSpecification() {
        // no instantiation allowed
    }

    @Override
    public boolean test(Class candidate) {
        return ClassPredicates.classIsAssignableFrom(CommandLineHandler.class)
                .and(ClassPredicates.classIsInterface().negate())
                .and(ClassPredicates.classModifierIs(Modifier.ABSTRACT).negate())
                .test(candidate);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy