89 lines
2.5 KiB
Java
89 lines
2.5 KiB
Java
package com.google.common.reflect;
|
|
|
|
import com.google.common.base.Preconditions;
|
|
import java.lang.annotation.Annotation;
|
|
import java.lang.reflect.AccessibleObject;
|
|
import java.lang.reflect.Member;
|
|
|
|
/* loaded from: classes.dex */
|
|
class Element extends AccessibleObject implements Member {
|
|
private final AccessibleObject a;
|
|
private final Member b;
|
|
|
|
<M extends AccessibleObject & Member> Element(M m) {
|
|
Preconditions.a(m);
|
|
this.a = m;
|
|
this.b = m;
|
|
}
|
|
|
|
public TypeToken<?> a() {
|
|
return TypeToken.of((Class) getDeclaringClass());
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (!(obj instanceof Element)) {
|
|
return false;
|
|
}
|
|
Element element = (Element) obj;
|
|
return a().equals(element.a()) && this.b.equals(element.b);
|
|
}
|
|
|
|
@Override // java.lang.reflect.AccessibleObject, java.lang.reflect.AnnotatedElement
|
|
public final <A extends Annotation> A getAnnotation(Class<A> cls) {
|
|
return (A) this.a.getAnnotation(cls);
|
|
}
|
|
|
|
@Override // java.lang.reflect.AccessibleObject, java.lang.reflect.AnnotatedElement
|
|
public final Annotation[] getAnnotations() {
|
|
return this.a.getAnnotations();
|
|
}
|
|
|
|
@Override // java.lang.reflect.AccessibleObject, java.lang.reflect.AnnotatedElement
|
|
public final Annotation[] getDeclaredAnnotations() {
|
|
return this.a.getDeclaredAnnotations();
|
|
}
|
|
|
|
@Override // java.lang.reflect.Member
|
|
public Class<?> getDeclaringClass() {
|
|
return this.b.getDeclaringClass();
|
|
}
|
|
|
|
@Override // java.lang.reflect.Member
|
|
public final int getModifiers() {
|
|
return this.b.getModifiers();
|
|
}
|
|
|
|
@Override // java.lang.reflect.Member
|
|
public final String getName() {
|
|
return this.b.getName();
|
|
}
|
|
|
|
public int hashCode() {
|
|
return this.b.hashCode();
|
|
}
|
|
|
|
@Override // java.lang.reflect.AccessibleObject
|
|
public final boolean isAccessible() {
|
|
return this.a.isAccessible();
|
|
}
|
|
|
|
@Override // java.lang.reflect.AccessibleObject, java.lang.reflect.AnnotatedElement
|
|
public final boolean isAnnotationPresent(Class<? extends Annotation> cls) {
|
|
return this.a.isAnnotationPresent(cls);
|
|
}
|
|
|
|
@Override // java.lang.reflect.Member
|
|
public final boolean isSynthetic() {
|
|
return this.b.isSynthetic();
|
|
}
|
|
|
|
@Override // java.lang.reflect.AccessibleObject
|
|
public final void setAccessible(boolean z) throws SecurityException {
|
|
this.a.setAccessible(z);
|
|
}
|
|
|
|
public String toString() {
|
|
return this.b.toString();
|
|
}
|
|
}
|