ValueDecorator extends EventSinkDecorator<S> { public ValueDecorator(S s, String attr, String value) { this(s, attr, value, false); } ValueDecorator(S s, String attr, String value);  ValueDecorator(S s, String attr, String value, boolean escape); void append(Event e); static SinkDecoBuilder builder(); static final String KW_ESCAPE; }
@Test public void testValueDecorator() throws IOException, InterruptedException { String value = "value%{nanos}"; ValueDecorator dec = new ValueDecorator(new ConsoleEventSink(), "attr", value, false); dec.open(); Event e = new EventImpl("body".getBytes(), 1234567L, Event.Priority.INFO, 87654321L, "host"); dec.append(e); Assert.assertNotNull("Attribute wasn't added", e.get("attr")); Assert.assertArrayEquals("Attribute value is incorrect", value.getBytes(), e.get("attr")); dec.close(); }