@JsonCreator public TDColumn( @JsonProperty("name") String name, @JsonProperty("type") String type, @JsonProperty("key") String key) { this(name, TDColumnType.parseColumnType(type), key.getBytes(UTF_8)); }
public static TDColumn parseTuple(String[] tuple) { // TODO encode key in some ways if (tuple != null) { if (tuple.length == 2) { // [ key, type ] return new TDColumn( tuple[0], TDColumnType.parseColumnType(tuple[1]), tuple[0].getBytes(StandardCharsets.UTF_8)); } else if (tuple.length == 3) { // [ key, type, name ] return new TDColumn( tuple[2], TDColumnType.parseColumnType(tuple[1]), tuple[0].getBytes(StandardCharsets.UTF_8)); } } throw new RuntimeJsonMappingException("Unexpected string tuple to deserialize TDColumn"); }