@Test public void testFromConnectNull() throws Exception { ProtobufData protobufData = new ProtobufData(); Schema schema = SchemaBuilder.struct().field(VALUE_FIELD_NAME, OPTIONAL_BOOLEAN_SCHEMA).build(); ProtobufSchemaAndValue converted = protobufData.fromConnectData(schema, null); assertNull(converted.getValue()); converted = protobufData.fromConnectData(null, null); assertNull(converted.getSchema()); assertNull(converted.getValue()); }
public ProtobufSchemaAndValue fromConnectData(Schema schema, Object value) { ProtobufSchema protobufSchema = fromConnectSchema(schema); Object ctx = null; if (schema != null) { String name = schema.name(); if (name == null) { name = DEFAULT_SCHEMA_NAME + "1"; } ctx = protobufSchema.toDescriptor(name); } return new ProtobufSchemaAndValue( protobufSchema, fromConnectData(ctx, schema, "", value, protobufSchema) ); }
ProtobufData { public ProtobufSchemaAndValue fromConnectData(Schema schema, Object value) { ProtobufSchema protobufSchema = fromConnectSchema(schema); Object ctx = null; if (schema != null) { String name = schema.name(); if (name == null) { name = DEFAULT_SCHEMA_NAME + "1"; } ctx = protobufSchema.toDescriptor(name); } return new ProtobufSchemaAndValue( protobufSchema, fromConnectData(ctx, schema, "", value, protobufSchema) ); } }
ProtobufData { public ProtobufSchemaAndValue fromConnectData(Schema schema, Object value) { ProtobufSchema protobufSchema = fromConnectSchema(schema); Object ctx = null; if (schema != null) { String name = schema.name(); if (name == null) { name = DEFAULT_SCHEMA_NAME + "1"; } ctx = protobufSchema.toDescriptor(name); } return new ProtobufSchemaAndValue( protobufSchema, fromConnectData(ctx, schema, "", value, protobufSchema) ); } ProtobufData();  ProtobufData(int cacheSize);  ProtobufData(ProtobufDataConfig protobufDataConfig); }
ProtobufData { public ProtobufSchemaAndValue fromConnectData(Schema schema, Object value) { ProtobufSchema protobufSchema = fromConnectSchema(schema); Object ctx = null; if (schema != null) { String name = schema.name(); if (name == null) { name = DEFAULT_SCHEMA_NAME + "1"; } ctx = protobufSchema.toDescriptor(name); } return new ProtobufSchemaAndValue( protobufSchema, fromConnectData(ctx, schema, "", value, protobufSchema) ); } ProtobufData();  ProtobufData(int cacheSize);  ProtobufData(ProtobufDataConfig protobufDataConfig); ProtobufSchemaAndValue fromConnectData(Schema schema, Object value); ProtobufSchema fromConnectSchema(Schema schema); SchemaAndValue toConnectData(ProtobufSchema protobufSchema, Message message); Schema toConnectSchema(ProtobufSchema schema); }
ProtobufData { public ProtobufSchemaAndValue fromConnectData(Schema schema, Object value) { ProtobufSchema protobufSchema = fromConnectSchema(schema); Object ctx = null; if (schema != null) { String name = schema.name(); if (name == null) { name = DEFAULT_SCHEMA_NAME + "1"; } ctx = protobufSchema.toDescriptor(name); } return new ProtobufSchemaAndValue( protobufSchema, fromConnectData(ctx, schema, "", value, protobufSchema) ); } ProtobufData();  ProtobufData(int cacheSize);  ProtobufData(ProtobufDataConfig protobufDataConfig); ProtobufSchemaAndValue fromConnectData(Schema schema, Object value); ProtobufSchema fromConnectSchema(Schema schema); SchemaAndValue toConnectData(ProtobufSchema protobufSchema, Message message); Schema toConnectSchema(ProtobufSchema schema); static final String NAMESPACE; static final String DEFAULT_SCHEMA_NAME; static final String MAP_ENTRY_SUFFIX; static final String KEY_FIELD; static final String VALUE_FIELD; static final String PROTOBUF_TYPE_ENUM; static final String PROTOBUF_TYPE_ENUM_PREFIX; static final String PROTOBUF_TYPE_UNION; static final String PROTOBUF_TYPE_UNION_PREFIX; static final String PROTOBUF_TYPE_TAG; static final String GOOGLE_PROTOBUF_PACKAGE; static final String GOOGLE_PROTOBUF_TIMESTAMP_NAME; static final String GOOGLE_PROTOBUF_TIMESTAMP_FULL_NAME; static final String GOOGLE_PROTOBUF_TIMESTAMP_LOCATION; }