本文整理了Java中java.lang.annotation.Annotation.equals()
方法的一些代码示例,展示了Annotation.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation.equals()
方法的具体详情如下:
包路径:java.lang.annotation.Annotation
类名称:Annotation
方法名:equals
[英]Determines whether or not this annotation is equivalent to the annotation passed. This is determined according to the following rules:
代码示例来源:origin: spring-projects/spring-framework
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
AnnotationConverterKey otherKey = (AnnotationConverterKey) other;
return (this.fieldType == otherKey.fieldType && this.annotation.equals(otherKey.annotation));
}
代码示例来源:origin: redisson/redisson
/**
* {@inheritDoc}
*/
public boolean represents(Object value) {
return annotation.equals(value);
}
代码示例来源:origin: org.springframework/spring-context
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
AnnotationConverterKey otherKey = (AnnotationConverterKey) other;
return (this.fieldType == otherKey.fieldType && this.annotation.equals(otherKey.annotation));
}
代码示例来源:origin: com.google.inject/guice
@Override
public boolean equals(Object o) {
if (!(o instanceof AnnotationInstanceStrategy)) {
return false;
}
AnnotationInstanceStrategy other = (AnnotationInstanceStrategy) o;
return annotation.equals(other.annotation);
}
代码示例来源:origin: spring-projects/spring-framework
private boolean annotationEquals(Annotation ann, Annotation otherAnn) {
// Annotation.equals is reflective and pretty slow, so let's check identity and proxy type first.
return (ann == otherAnn || (ann.getClass() == otherAnn.getClass() && ann.equals(otherAnn)));
}
代码示例来源:origin: com.google.inject/guice
@Override
public boolean equals(Object other) {
return other instanceof AnnotatedWith
&& ((AnnotatedWith) other).annotation.equals(annotation);
}
代码示例来源:origin: prestodb/presto
protected final boolean _add(Annotation ann) {
if (_annotations == null) {
_annotations = new HashMap<Class<?>,Annotation>();
}
Annotation previous = _annotations.put(ann.annotationType(), ann);
return (previous == null) || !previous.equals(ann);
}
}
代码示例来源:origin: redisson/redisson
protected final boolean _add(Annotation ann) {
if (_annotations == null) {
_annotations = new HashMap<Class<?>,Annotation>();
}
Annotation previous = _annotations.put(ann.annotationType(), ann);
return (previous == null) || !previous.equals(ann);
}
}
代码示例来源:origin: org.springframework/spring-core
private boolean annotationEquals(Annotation ann, Annotation otherAnn) {
// Annotation.equals is reflective and pretty slow, so let's check identity and proxy type first.
return (ann == otherAnn || (ann.getClass() == otherAnn.getClass() && ann.equals(otherAnn)));
}
代码示例来源:origin: jersey/jersey
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BindingModel that = (BindingModel) o;
return annotation != null ? annotation.equals(that.annotation) : that.annotation == null;
}
代码示例来源:origin: jersey/jersey
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BindingModel that = (BindingModel) o;
return annotation != null ? annotation.equals(that.annotation) : that.annotation == null;
}
代码示例来源:origin: com.google.inject/guice
@Override
public boolean matches(AnnotatedElement element) {
Annotation fromElement = element.getAnnotation(annotation.annotationType());
return fromElement != null && annotation.equals(fromElement);
}
代码示例来源:origin: com.google.inject/guice
@Override
public boolean equals(Object obj) {
if (obj instanceof ProviderMethod) {
ProviderMethod<?> o = (ProviderMethod<?>) obj;
return method.equals(o.method)
&& instance.equals(o.instance)
&& annotation.equals(o.annotation);
} else {
return false;
}
}
代码示例来源:origin: apache/drill
protected final boolean _add(Annotation ann) {
if (_annotations == null) {
_annotations = new HashMap<Class<?>,Annotation>();
}
Annotation previous = _annotations.put(ann.annotationType(), ann);
return (previous == null) || !previous.equals(ann);
}
}
代码示例来源:origin: jersey/jersey
return false;
if (sourceAnnotation != null ? !sourceAnnotation.equals(parameter.sourceAnnotation) : parameter.sourceAnnotation
!= null) {
return false;
代码示例来源:origin: jersey/jersey
return false;
if (sourceAnnotation != null ? !sourceAnnotation.equals(parameter.sourceAnnotation) : parameter.sourceAnnotation
!= null) {
return false;
代码示例来源:origin: redisson/redisson
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
} else if (!(other instanceof AnnotationValue.Loaded<?>)) {
return false;
}
AnnotationValue.Loaded<?> annotationValue = (AnnotationValue.Loaded<?>) other;
return annotationValue.getState().isResolved() && annotation.equals(annotationValue.resolve());
}
代码示例来源:origin: spring-projects/spring-framework
if (targetAnnotation != null && targetAnnotation.equals(annotation)) {
return true;
代码示例来源:origin: org.springframework/spring-beans
if (targetAnnotation != null && targetAnnotation.equals(annotation)) {
return true;
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
public boolean equals(Object o) {
if (!(o instanceof AnnotationInstanceStrategy)) {
return false;
}
AnnotationInstanceStrategy other = (AnnotationInstanceStrategy) o;
return annotation.equals(other.annotation);
}
内容来源于网络,如有侵权,请联系作者删除!