Remove deprecated methods
This commit is contained in:
parent
a80186d068
commit
c59cf916ea
@ -1,6 +1,5 @@
|
|||||||
package it.cavallium.data.generator;
|
package it.cavallium.data.generator;
|
||||||
|
|
||||||
import com.squareup.javapoet.AnnotationSpec;
|
|
||||||
import com.squareup.javapoet.ArrayTypeName;
|
import com.squareup.javapoet.ArrayTypeName;
|
||||||
import com.squareup.javapoet.ClassName;
|
import com.squareup.javapoet.ClassName;
|
||||||
import com.squareup.javapoet.CodeBlock;
|
import com.squareup.javapoet.CodeBlock;
|
||||||
@ -2064,17 +2063,6 @@ public class SourcesGenerator {
|
|||||||
: typeTypes.get(fieldInfo.fieldType);
|
: typeTypes.get(fieldInfo.fieldType);
|
||||||
// Add common data getter
|
// Add common data getter
|
||||||
{
|
{
|
||||||
var oldGetterMethod = MethodSpec
|
|
||||||
.methodBuilder("get" + capitalize(fieldInfo.fieldName))
|
|
||||||
.addModifiers(Modifier.PUBLIC)
|
|
||||||
.addModifiers(Modifier.ABSTRACT)
|
|
||||||
.addAnnotation(Deprecated.class)
|
|
||||||
.returns(fieldTypeType);
|
|
||||||
if (!fieldTypeType.isPrimitive()) {
|
|
||||||
oldGetterMethod.addAnnotation(NotNull.class);
|
|
||||||
}
|
|
||||||
typeInterface.addMethod(oldGetterMethod.build());
|
|
||||||
|
|
||||||
var getterMethod = MethodSpec
|
var getterMethod = MethodSpec
|
||||||
.methodBuilder(fieldInfo.fieldName)
|
.methodBuilder(fieldInfo.fieldName)
|
||||||
.addModifiers(Modifier.PUBLIC)
|
.addModifiers(Modifier.PUBLIC)
|
||||||
@ -2186,7 +2174,7 @@ public class SourcesGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addField(typeClass, key, typeTypes.get(value), true, true, true, false, isGetterOverride);
|
addField(typeClass, key, typeTypes.get(value), true, true, false);
|
||||||
addImmutableSetter(typeClass,
|
addImmutableSetter(typeClass,
|
||||||
ClassName.get(joinPackage(versionPackage, "data"), type),
|
ClassName.get(joinPackage(versionPackage, "data"), type),
|
||||||
classConfiguration.getData().keySet(),
|
classConfiguration.getData().keySet(),
|
||||||
@ -2746,7 +2734,7 @@ public class SourcesGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addField(Builder classBuilder, String fieldName,
|
private void addField(Builder classBuilder, String fieldName,
|
||||||
TypeName fieldType, boolean isRecord, boolean isFinal, boolean hasGetter, boolean hasSetter, boolean isOverride) {
|
TypeName fieldType, boolean isRecord, boolean isFinal, boolean hasSetter) {
|
||||||
if (isFinal && hasSetter) {
|
if (isFinal && hasSetter) {
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
@ -2772,21 +2760,6 @@ public class SourcesGenerator {
|
|||||||
}
|
}
|
||||||
classBuilder.addField(field.build());
|
classBuilder.addField(field.build());
|
||||||
}
|
}
|
||||||
if (hasGetter) {
|
|
||||||
var getter = MethodSpec.methodBuilder("get" + capitalize(fieldName));
|
|
||||||
getter.addModifiers(Modifier.PUBLIC);
|
|
||||||
getter.addModifiers(Modifier.FINAL);
|
|
||||||
if (!fieldType.isPrimitive()) {
|
|
||||||
getter.addAnnotation(NotNull.class);
|
|
||||||
}
|
|
||||||
if (isOverride) {
|
|
||||||
getter.addAnnotation(Override.class);
|
|
||||||
}
|
|
||||||
getter.addAnnotation(Deprecated.class);
|
|
||||||
getter.returns(fieldType);
|
|
||||||
getter.addStatement("return this." + fieldName);
|
|
||||||
classBuilder.addMethod(getter.build());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int indexOf(Set<String> value, String type) {
|
private int indexOf(Set<String> value, String type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user