
br.com.objectos.pojo.plugin.Condition Maven / Gradle / Ivy
/*
* Copyright 2014-2015 Objectos, Fábrica de Software LTDA.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package br.com.objectos.pojo.plugin;
import java.lang.annotation.Annotation;
import java.util.Objects;
import br.com.objectos.code.MethodInfo;
/**
* @author [email protected] (Marcio Endo)
*/
public abstract class Condition implements MethodCondition, PojoCondition, PropertyCondition {
Condition() {
}
public static Condition hasAnnotation(Class extends Annotation> type) {
Objects.requireNonNull(type);
return new HasAnnotationCondition(type);
}
public static Condition hasAnnotationAnnotatedWith(Class extends Annotation> type) {
Objects.requireNonNull(type);
return new HasAnnotationAnnotatedWithCondition(type);
}
public static Condition hasInterface(Class> type) {
Objects.requireNonNull(type);
return new HasInterfaceCondition(type);
}
public static Condition hasName(String name) {
Objects.requireNonNull(name);
return new HasNameCondition(name);
}
public static Condition instanceOf(Class> type) {
Objects.requireNonNull(type);
return new InstanceOfCondition(type);
}
@Override
public abstract boolean test(MethodInfo method);
@Override
public abstract boolean test(PojoInfo pojoInfo);
@Override
public abstract boolean test(Property property);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy