![JAR search and dependency download from the Maven repository](/logo.png)
com.google.auto.common.AnnotationValues Maven / Gradle / Ivy
/*
* Copyright (C) 2014 Google, Inc.
*
* 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 com.google.auto.common;
import com.google.common.base.Equivalence;
import java.util.List;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.SimpleAnnotationValueVisitor6;
/**
* A utility class for working with {@link AnnotationValue} instances.
*
* @author Christian Gruber
*/
public final class AnnotationValues {
private static final Equivalence ANNOTATION_VALUE_EQUIVALENCE =
new Equivalence() {
@Override protected boolean doEquivalent(AnnotationValue left, AnnotationValue right) {
return left.accept(new SimpleAnnotationValueVisitor6() {
// LHS is not an annotation or array of annotation values, so just test equality.
@Override protected Boolean defaultAction(Object left, AnnotationValue right) {
return left.equals(right.accept(
new SimpleAnnotationValueVisitor6
© 2015 - 2025 Weber Informatics LLC | Privacy Policy