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

br.com.objectos.way.code.AnnotationInfoHasAnnotation Maven / Gradle / Ivy

The newest version!
package br.com.objectos.way.code;

import com.google.common.base.Predicate;
import java.lang.annotation.Annotation;
import javax.annotation.Generated;

@Generated("br.com.objectos.way.auto.functional.AutoFunctionalProcessor")
public final class AnnotationInfoHasAnnotation implements Predicate {
  private final Class type;

  private AnnotationInfoHasAnnotation(Class type) {
    this.type = type;
  }

  public static Predicate get(Class type) {
    return new AnnotationInfoHasAnnotation(type);
  }

  public static Predicate not(Class type) {
    return new AnnotationInfoHasAnnotationNot(type);
  }

  @Override
  public boolean apply(AnnotationInfo input) {
    return input.hasAnnotation(type);
  }

  private static final class AnnotationInfoHasAnnotationNot implements Predicate {
    private final Class type;

    private AnnotationInfoHasAnnotationNot(Class type) {
      this.type = type;
    }

    @Override
    public boolean apply(AnnotationInfo input) {
      return !input.hasAnnotation(type);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy