Convert class for metric field to AutoValue
This reduces the number of static methods for creating fields and allows us to extend the Field class in future. Change-Id: Ieaaacddd03b1e04e4e91f000eff950ecb292ec25 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -189,10 +189,10 @@ class MetricJson {
|
||||
String description;
|
||||
|
||||
FieldJson(Field<?> field) {
|
||||
this.name = field.getName();
|
||||
this.description = field.getDescription();
|
||||
this.name = field.name();
|
||||
this.description = field.description().orElse(null);
|
||||
this.type =
|
||||
Enum.class.isAssignableFrom(field.getType()) ? field.getType().getSimpleName() : null;
|
||||
Enum.class.isAssignableFrom(field.valueType()) ? field.valueType().getSimpleName() : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user