ice: Use classes to create describe metadata instead of stringBuilder.#21
ice: Use classes to create describe metadata instead of stringBuilder.#21
Conversation
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import lombok.Data; |
There was a problem hiding this comment.
can we use standard records instead of pulling in lombok? looks like jackson already supports them
There was a problem hiding this comment.
can we use standard
records instead of pulling in lombok? looks like jackson already supports them,
lombok is for adding setter/getter , unfortunately data is misleading.
https://projectlombok.org/features/Data
@DaTa is a convenient shortcut annotation that bundles the features of @ToString, @EqualsAndHashCode, @Getter / @Setter and @RequiredArgsConstructor together: In other words, @DaTa generates all the boilerplate that is normally associated with simple POJOs (Plain Old Java Objects) and beans: getters for all fields, setters for all non-final fields, and appropriate toString, equals and hashCode implementations that involve the fields of the class, and a constructor that initializes all final fields, as well as all non-final fields with no initializer that have been marked with @nonnull, in order to ensure the field is never null.
There was a problem hiding this comment.
I get that but we don't really care about any of that in this case. All we need is something to holds the data before it gets converted to yaml/json. A Map would work, but records would be even better. Pulling lombok when both Maps and records would suffice feels excessive.
| // TODO: refactor: the use of StringBuilder below is absolutely criminal | ||
| public static void run(RESTCatalog catalog, String target, boolean json, boolean includeMetrics) | ||
| throws IOException { | ||
| public static void run(RESTCatalog catalog, String target, boolean json) throws IOException { |
There was a problem hiding this comment.
looks like TableMetadata, etc. records are defined but not actually used...
closes: #19