Package io.determann.shadow.impl.shadow
Class VariableImpl<SURROUNDING extends Shadow<? extends TypeMirror>>
java.lang.Object
io.determann.shadow.impl.shadow.ShadowImpl<TypeMirror>
io.determann.shadow.impl.shadow.VariableImpl<SURROUNDING>
- All Implemented Interfaces:
Annotationable<VariableElement>,ApiHolder,ElementBacked<VariableElement>,MirrorBacked<TypeMirror>,Modifiable,Shadow<TypeMirror>,Variable<SURROUNDING>
- Direct Known Subclasses:
EnumConstantImpl,FieldImpl,ParameterImpl
public abstract class VariableImpl<SURROUNDING extends Shadow<? extends TypeMirror>>
extends ShadowImpl<TypeMirror>
implements Variable<SURROUNDING>
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVariableImpl(ShadowApi shadowApi, VariableElement variableElement) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbe careful using this equalsgetType()inthashCode()booleanisAssignableFrom(Shadow<? extends TypeMirror> shadow) Equivalent toVariable.isSubtypeOf(Shadow)except for primitives.booleanisSubtypeOf(Shadow<? extends TypeMirror> shadow) returns true if this can be cast to that.toString()Methods inherited from class io.determann.shadow.impl.shadow.ShadowImpl
getApi, getMirror, isTypeKind, representsSameTypeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.determann.shadow.api.Annotationable
getAnnotationUsages, getDirectAnnotationUsages, getDirectUsageOf, getDirectUsageOfOrThrow, getDirectUsagesOf, getUsageOf, getUsageOfOrThrow, getUsagesOf, isAnnotatedWith, isDirectlyAnnotatedWithMethods inherited from interface io.determann.shadow.api.ElementBacked
getJavaDoc, getModifiers, getModule, getSimpleName, logError, logInfo, logWarningMethods inherited from interface io.determann.shadow.api.modifier.Modifiable
hasModifierMethods inherited from interface io.determann.shadow.api.shadow.Shadow
getApi, getMirror, isTypeKind, representsSameType
-
Constructor Details
-
VariableImpl
-
-
Method Details
-
isSubtypeOf
Description copied from interface:Variablereturns true if this can be cast to that. This can be useful if you want to check if a shadow implements for example aCollectionshadowToTest.erasure().isSubtypeOf(shadowApi.getDeclaredOrThrow("java.util.Collection").erasure())- Specified by:
isSubtypeOfin interfaceVariable<SURROUNDING extends Shadow<? extends TypeMirror>>
-
isAssignableFrom
Description copied from interface:VariableEquivalent toVariable.isSubtypeOf(Shadow)except for primitives. if one is a primitive and the other is not it tries to convert them- Specified by:
isAssignableFromin interfaceVariable<SURROUNDING extends Shadow<? extends TypeMirror>>
-
getType
- Specified by:
getTypein interfaceVariable<SURROUNDING extends Shadow<? extends TypeMirror>>
-
getPackage
- Specified by:
getPackagein interfaceVariable<SURROUNDING extends Shadow<? extends TypeMirror>>
-
getElement
- Specified by:
getElementin interfaceElementBacked<SURROUNDING extends Shadow<? extends TypeMirror>>
-
getTypeKind
- Specified by:
getTypeKindin interfaceShadow<SURROUNDING extends Shadow<? extends TypeMirror>>
-
toString
- Overrides:
toStringin classShadowImpl<TypeMirror>
-
getSurrounding
Description copied from interface:Variable- Specified by:
getSurroundingin interfaceVariable<SURROUNDING extends Shadow<? extends TypeMirror>>
-
hashCode
public int hashCode() -
equals
Description copied from interface:Variablebe careful using this equals- Specified by:
equalsin interfaceShadow<SURROUNDING extends Shadow<? extends TypeMirror>>- Specified by:
equalsin interfaceVariable<SURROUNDING extends Shadow<? extends TypeMirror>>- Overrides:
equalsin classObject- See Also:
-