protected void append(ByteBuffer b) { append(b.array()); }
/** * Obtain a JSON string representation of the specified field. * * @param field the field; may not be null * @return the JSON string representation */ public static String asDetailedString(Field field) { return new RecordWriter().detailed(true).append(field).toString(); }
/** * Obtain a JSON string representation of the specified {@link Schema}. * * @param schema the {@link Schema}; may not be null * @return the JSON string representation */ public static String asString(Schema schema) { return new RecordWriter().append(schema).toString(); }
/** * Obtain a JSON string representation of the specified field. * * @param field the field; may not be null * @return the JSON string representation */ public static String asString(Field field) { return new RecordWriter().append(field).toString(); }
/** * Obtain a JSON string representation of the specified {@link Struct}. * * @param struct the {@link Struct}; may not be null * @return the JSON string representation */ public static String asDetailedString(Struct struct) { return new RecordWriter().detailed(true).append(struct).toString(); }
/** * Obtain a JSON string representation of the specified {@link SourceRecord}. * * @param record the {@link SourceRecord}; may not be null * @return the JSON string representation */ public static String asString(SourceRecord record) { return new RecordWriter().append(record).toString(); }
append((ByteBuffer)obj); } else if (obj instanceof byte[]) { append((byte[])obj); } else if (obj instanceof Map<?, ?>) { Map<?, ?> map = (Map<?, ?>) obj; else sb.append(", "); append(value); } else if ( obj instanceof java.sql.Time ){ java.sql.Time time = (java.sql.Time)obj; append(DateTimeFormatter.ISO_LOCAL_TIME.format(time.toLocalTime())); } else if ( obj instanceof java.sql.Date ){ java.sql.Date date = (java.sql.Date)obj; append(DateTimeFormatter.ISO_DATE.format(date.toLocalDate())); } else if ( obj instanceof java.sql.Timestamp ){ java.sql.Timestamp ts = (java.sql.Timestamp)obj; Instant instant = ts.toInstant(); append(DateTimeFormatter.ISO_INSTANT.format(instant)); } else if ( obj instanceof java.util.Date ){ java.util.Date date = (java.util.Date)obj; append(DateTimeFormatter.ISO_INSTANT.format(date.toInstant())); } else if ( obj instanceof TemporalAccessor ){ TemporalAccessor temporal = (TemporalAccessor)obj; append(DateTimeFormatter.ISO_INSTANT.format(temporal)); } else { append(obj.toString());
/** * Obtain a JSON string representation of the specified {@link Struct}. * * @param struct the {@link Struct}; may not be null * @return the JSON string representation */ public static String asString(Struct struct) { return new RecordWriter().append(struct).toString(); }
/** * Obtain a JSON string representation of the specified field. * * @param field the field; may not be null * @return the JSON string representation */ public static String asString(Field field) { return new RecordWriter().append(field).toString(); }
/** * Obtain a JSON string representation of the specified {@link SourceRecord}. * * @param record the {@link SourceRecord}; may not be null * @return the JSON string representation */ public static String asDetailedString(SourceRecord record) { return new RecordWriter().detailed(true).append(record).toString(); }
/** * Obtain a JSON string representation of the specified {@link SourceRecord}. * * @param record the {@link SourceRecord}; may not be null * @return the JSON string representation */ public static String asString(SourceRecord record) { return new RecordWriter().append(record).toString(); }
/** * Obtain a JSON string representation of the specified {@link Schema}. * * @param schema the {@link Schema}; may not be null * @return the JSON string representation */ public static String asDetailedString(Schema schema) { return new RecordWriter().detailed(true).append(schema).toString(); }
/** * Obtain a JSON string representation of the specified {@link Struct}. * * @param struct the {@link Struct}; may not be null * @return the JSON string representation */ public static String asDetailedString(Struct struct) { return new RecordWriter().detailed(true).append(struct).toString(); }
/** * Obtain a JSON string representation of the specified field. * * @param field the field; may not be null * @return the JSON string representation */ public static String asString(Object field) { return new RecordWriter().append(field).toString(); }
/** * Obtain a JSON string representation of the specified field. * * @param field the field; may not be null * @return the JSON string representation */ public static String asDetailedString(Field field) { return new RecordWriter().detailed(true).append(field).toString(); }
/** * Obtain a JSON string representation of the specified {@link Schema}. * * @param schema the {@link Schema}; may not be null * @return the JSON string representation */ public static String asString(Schema schema) { return new RecordWriter().append(schema).toString(); }