@Test public void schemaless() { final Map<String, Object> value = new HashMap<>(); value.put("magic", 42); value.put("bool", true); value.put("byte", (byte) 42); value.put("short", (short) 42); value.put("int", 42); value.put("long", 42L); value.put("float", 42f); value.put("double", 42d); value.put("string", "blabla"); value.put("date", new Date()); value.put("bigint", new BigInteger("42")); value.put("bigdec", new BigDecimal("42.0")); value.put("list", Collections.singletonList(42)); value.put("map", Collections.singletonMap("key", "value")); final List<String> maskFields = new ArrayList<>(value.keySet()); maskFields.remove("magic"); final Map<String, Object> updatedValue = (Map) transform(maskFields).apply(record(null, value)).value(); assertEquals(42, updatedValue.get("magic")); assertEquals(false, updatedValue.get("bool")); assertEquals((byte) 0, updatedValue.get("byte")); assertEquals((short) 0, updatedValue.get("short")); assertEquals(0, updatedValue.get("int")); assertEquals(0L, updatedValue.get("long")); assertEquals(0f, updatedValue.get("float")); assertEquals(0d, updatedValue.get("double")); assertEquals("", updatedValue.get("string")); assertEquals(new Date(0), updatedValue.get("date")); assertEquals(BigInteger.ZERO, updatedValue.get("bigint")); assertEquals(BigDecimal.ZERO, updatedValue.get("bigdec")); assertEquals(Collections.emptyList(), updatedValue.get("list")); assertEquals(Collections.emptyMap(), updatedValue.get("map")); }
@Override public R apply(R record) { if (operatingSchema(record) == null) { return applySchemaless(record); } else { return applyWithSchema(record); } }
MaskField implements Transformation<R> { @Override public R apply(R record) { if (operatingSchema(record) == null) { return applySchemaless(record); } else { return applyWithSchema(record); } } }
MaskField implements Transformation<R> { @Override public R apply(R record) { if (operatingSchema(record) == null) { return applySchemaless(record); } else { return applyWithSchema(record); } }  }
MaskField implements Transformation<R> { @Override public R apply(R record) { if (operatingSchema(record) == null) { return applySchemaless(record); } else { return applyWithSchema(record); } }  @Override void configure(Map<String, ?> props); @Override R apply(R record); @Override ConfigDef config(); @Override void close(); }
MaskField implements Transformation<R> { @Override public R apply(R record) { if (operatingSchema(record) == null) { return applySchemaless(record); } else { return applyWithSchema(record); } }  @Override void configure(Map<String, ?> props); @Override R apply(R record); @Override ConfigDef config(); @Override void close(); static final String OVERVIEW_DOC; static final ConfigDef CONFIG_DEF; }