static MethodSpec generateStandardAutoValueConstructor(Map<String, TypeName> properties) { List<ParameterSpec> params = Lists.newArrayList(); for (Map.Entry<String, TypeName> entry : properties.entrySet()) { params.add(ParameterSpec.builder(entry.getValue().withoutAnnotations(), entry.getKey()).build()); } MethodSpec.Builder builder = MethodSpec.constructorBuilder() .addParameters(params); StringBuilder superFormat = new StringBuilder("super("); for (int i = properties.size(); i > 0; i--) { superFormat.append("$N"); if (i > 1) { superFormat.append(", "); } } superFormat.append(")"); builder.addStatement(superFormat.toString(), properties.keySet().toArray()); return builder.build(); }
static AnnotationSpec getTypeAdapterSpec(TypeName originalType) { AnnotationSpec firebaseAdapter = AnnotationSpec.builder(FirebaseAdapter.class).build(); AnnotationSpec typeAdapterSpec = null; for (AnnotationSpec annotation : originalType.annotations) { if (annotation.type.withoutAnnotations().equals(firebaseAdapter.type)) { typeAdapterSpec= annotation; break; } } return typeAdapterSpec; }
String fieldName = entry.getKey(); boolean hasTypeAdapter = typeHasAdapter(entry.getValue()); TypeName type = entry.getValue().withoutAnnotations();
if (!(parameter.type.isPrimitive() || parameter.type.isBoxedPrimitive() || parameter.type.withoutAnnotations().toString() .equals("java.lang.String"))) { builder.addParameter(parameter.toBuilder().addAnnotation(Valid.class).build());
if (typeName.isAnnotated()) { typeName.emitAnnotations(this); typeName = typeName.withoutAnnotations();
if (typeName.isAnnotated()) { typeName.emitAnnotations(this); typeName = typeName.withoutAnnotations();