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

org.seedstack.netflix.feign.internal.FeignInterfaceSpecification Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2013-2016, 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.netflix.feign.internal;

import feign.RequestLine;
import org.kametic.specifications.AbstractSpecification;
import org.seedstack.netflix.feign.FeignApi;
import org.seedstack.shed.reflect.AnnotationPredicates;
import org.seedstack.shed.reflect.ClassPredicates;

/**
 * The specification matches classes that are Interfaces and have methods annotated with @{@link RequestLine}
 *
 * @author [email protected]
 */
class FeignInterfaceSpecification extends AbstractSpecification> {
    @Override
    public boolean isSatisfiedBy(Class candidate) {
        return ClassPredicates
                .classIsInterface()
                .and(AnnotationPredicates.elementAnnotatedWith(FeignApi.class, false))
                .and(AnnotationPredicates.atLeastOneMethodAnnotatedWith(RequestLine.class, false))
                .test(candidate);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy