Class MemoizeExtension.Generator.MethodOverrider
- java.lang.Object
-
- com.google.auto.value.extension.memoized.processor.MemoizeExtension.Generator.MethodOverrider
-
- Enclosing class:
- MemoizeExtension.Generator
private final class MemoizeExtension.Generator.MethodOverrider extends java.lang.ObjectDetermines the required fields and overriding method for a@Memoizedmethod.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classMemoizeExtension.Generator.MethodOverrider.CheckBooleanFieldprivate classMemoizeExtension.Generator.MethodOverrider.InitializationStrategyprivate classMemoizeExtension.Generator.MethodOverrider.NullMeansUninitialized
-
Field Summary
Fields Modifier and Type Field Description private com.squareup.javapoet.FieldSpeccacheFieldprivate com.google.common.collect.ImmutableList.Builder<com.squareup.javapoet.FieldSpec>fieldsprivate javax.lang.model.element.ExecutableElementmethodprivate com.squareup.javapoet.MethodSpec.Builderoverride
-
Constructor Summary
Constructors Constructor Description MethodOverrider(javax.lang.model.element.ExecutableElement method)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private com.squareup.javapoet.FieldSpecbuildCacheField(com.squareup.javapoet.TypeName type, java.lang.String name)Builds aFieldSpecfor use in property caching.private voidcheckIllegalModifier(javax.lang.model.element.Modifier modifier)(package private) java.lang.Iterable<com.squareup.javapoet.FieldSpec>fields()The fields that should be added to the subclass.(package private) com.squareup.javapoet.MethodSpecmethod()The overriding method that should be added to the subclass.private javax.lang.model.element.ExecutableElementobjectMethod(java.lang.String methodName)private booleanoverridesObjectMethod(java.lang.String methodName)private voidprintMessage(javax.tools.Diagnostic.Kind kind, java.lang.String format, java.lang.Object... args)private booleanpullDownMethodAnnotation(javax.lang.model.element.AnnotationMirror annotation)(package private) MemoizeExtension.Generator.MethodOverrider.InitializationStrategystrategy()private voidvalidate()
-
-
-
Field Detail
-
method
private final javax.lang.model.element.ExecutableElement method
-
override
private final com.squareup.javapoet.MethodSpec.Builder override
-
cacheField
private final com.squareup.javapoet.FieldSpec cacheField
-
fields
private final com.google.common.collect.ImmutableList.Builder<com.squareup.javapoet.FieldSpec> fields
-
-
Method Detail
-
fields
java.lang.Iterable<com.squareup.javapoet.FieldSpec> fields()
The fields that should be added to the subclass.
-
method
com.squareup.javapoet.MethodSpec method()
The overriding method that should be added to the subclass.
-
validate
private void validate()
-
checkIllegalModifier
private void checkIllegalModifier(javax.lang.model.element.Modifier modifier)
-
printMessage
private void printMessage(javax.tools.Diagnostic.Kind kind, java.lang.String format, java.lang.Object... args)
-
overridesObjectMethod
private boolean overridesObjectMethod(java.lang.String methodName)
-
objectMethod
private javax.lang.model.element.ExecutableElement objectMethod(java.lang.String methodName)
-
pullDownMethodAnnotation
private boolean pullDownMethodAnnotation(javax.lang.model.element.AnnotationMirror annotation)
-
buildCacheField
private com.squareup.javapoet.FieldSpec buildCacheField(com.squareup.javapoet.TypeName type, java.lang.String name)Builds aFieldSpecfor use in property caching. Field will beprivate volatileand have the given type and name. If the @LazyInit annotation is available it is added as well.
-
strategy
MemoizeExtension.Generator.MethodOverrider.InitializationStrategy strategy()
-
-