Skip to content

Commit

Permalink
Remove unused param, remove public where not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave committed Nov 30, 2023
1 parent 26ebafe commit fc0eeed
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ final class FieldReader {
initAliases(element);
}

public void readParam(VariableElement element) {
void readParam(VariableElement element) {
this.deserialize = true;
this.isCreatorParam = true;
initAliases(element);
Expand Down Expand Up @@ -251,43 +251,35 @@ public String toString() {
return property.fieldName();
}

public GenericType type() {
GenericType type() {
return property.genericType();
}

public boolean isConstructorParam() {
boolean isConstructorParam() {
return property.isConstructorParam();
}

public String fieldNameWithNum() {
String fieldNameWithNum() {
return property.fieldName() + num;
}

public String adapterFieldName() {
String adapterFieldName() {
return property.adapterFieldName();
}

public MethodReader setter() {
MethodReader setter() {
return property.setter();
}

public void setSetter(MethodReader setter) {
property.setSetterMethod(setter);
}

public void setDeserialize(boolean deserialize) {
this.deserialize = deserialize;
}

public boolean isDeserialize() {
boolean isDeserialize() {
return deserialize;
}

public Map<String, TypeSubTypeMeta> subTypes() {
Map<String, TypeSubTypeMeta> subTypes() {
return subTypes;
}

public List<String> aliases() {
List<String> aliases() {
return aliases;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ List<MethodParam> getParams() {
return params;
}

public boolean isPublic() {
boolean isPublic() {
return element.getModifiers().contains(Modifier.PUBLIC);
}

public boolean isProtected() {
boolean isProtected() {
return element.getModifiers().contains(Modifier.PROTECTED);
}

public String creationString() {
String creationString() {
var shortName = Util.shortName(((TypeElement) element.getEnclosingElement()).getQualifiedName().toString());
if (element.getKind() == ElementKind.CONSTRUCTOR) {
return String.format("new %s(", shortName);
}
return String.format("%s.%s(", shortName, element.getSimpleName());
}

public ExecutableElement element() {
ExecutableElement element() {
return element;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void read(TypeElement type) {
readField(element, localFields);
break;
case METHOD:
readMethod(element, type, localFields);
readMethod(element, localFields);
break;
}
}
Expand Down Expand Up @@ -229,7 +229,7 @@ private void readConstructor(Element element, TypeElement type) {
}
}

private void readMethod(Element element, TypeElement type, List<FieldReader> localFields) {
private void readMethod(Element element, List<FieldReader> localFields) {
ExecutableElement methodElement = (ExecutableElement) element;
if (checkMethod2(methodElement)) {
List<? extends VariableElement> parameters = methodElement.getParameters();
Expand Down

0 comments on commit fc0eeed

Please sign in to comment.