30
30
import com .googlecode .androidannotations .annotations .sharedpreferences .DefaultBoolean ;
31
31
import com .googlecode .androidannotations .annotations .sharedpreferences .DefaultFloat ;
32
32
import com .googlecode .androidannotations .annotations .sharedpreferences .DefaultInt ;
33
+ import com .googlecode .androidannotations .annotations .sharedpreferences .DefaultLong ;
33
34
import com .googlecode .androidannotations .annotations .sharedpreferences .DefaultString ;
34
35
import com .googlecode .androidannotations .annotations .sharedpreferences .SharedPref ;
35
36
import com .googlecode .androidannotations .annotations .sharedpreferences .SharedPref .Scope ;
41
42
import com .googlecode .androidannotations .api .sharedpreferences .IntPrefEditorField ;
42
43
import com .googlecode .androidannotations .api .sharedpreferences .IntPrefField ;
43
44
import com .googlecode .androidannotations .api .sharedpreferences .LongPrefEditorField ;
45
+ import com .googlecode .androidannotations .api .sharedpreferences .LongPrefField ;
44
46
import com .googlecode .androidannotations .api .sharedpreferences .SharedPreferencesHelper ;
45
47
import com .googlecode .androidannotations .api .sharedpreferences .StringPrefEditorField ;
46
48
import com .googlecode .androidannotations .api .sharedpreferences .StringPrefField ;
@@ -193,8 +195,7 @@ public void process(Element element, JCodeModel codeModel, EBeansHolder activiti
193
195
defaultValue = JExpr .lit (false );
194
196
}
195
197
addFieldHelperMethod (helperClass , fieldName , defaultValue , BooleanPrefField .class , "booleanField" );
196
- }
197
- if ("float" .equals (returnType )) {
198
+ } else if ("float" .equals (returnType )) {
198
199
JExpression defaultValue ;
199
200
DefaultFloat defaultAnnotation = method .getAnnotation (DefaultFloat .class );
200
201
if (defaultAnnotation != null ) {
@@ -203,8 +204,7 @@ public void process(Element element, JCodeModel codeModel, EBeansHolder activiti
203
204
defaultValue = JExpr .lit (0f );
204
205
}
205
206
addFieldHelperMethod (helperClass , fieldName , defaultValue , FloatPrefField .class , "floatField" );
206
- }
207
- if ("int" .equals (returnType )) {
207
+ } else if ("int" .equals (returnType )) {
208
208
JExpression defaultValue ;
209
209
DefaultInt defaultAnnotation = method .getAnnotation (DefaultInt .class );
210
210
if (defaultAnnotation != null ) {
@@ -213,8 +213,16 @@ public void process(Element element, JCodeModel codeModel, EBeansHolder activiti
213
213
defaultValue = JExpr .lit (0 );
214
214
}
215
215
addFieldHelperMethod (helperClass , fieldName , defaultValue , IntPrefField .class , "intField" );
216
- }
217
- if ("java.lang.String" .equals (returnType )) {
216
+ } else if ("long" .equals (returnType )) {
217
+ JExpression defaultValue ;
218
+ DefaultLong defaultAnnotation = method .getAnnotation (DefaultLong .class );
219
+ if (defaultAnnotation != null ) {
220
+ defaultValue = JExpr .lit (defaultAnnotation .value ());
221
+ } else {
222
+ defaultValue = JExpr .lit (0l );
223
+ }
224
+ addFieldHelperMethod (helperClass , fieldName , defaultValue , LongPrefField .class , "longField" );
225
+ } else if ("java.lang.String" .equals (returnType )) {
218
226
JExpression defaultValue ;
219
227
DefaultString defaultAnnotation = method .getAnnotation (DefaultString .class );
220
228
if (defaultAnnotation != null ) {
0 commit comments