QueryKey { public String asPlainKey() { return StringUtils.join( keyComponents, COMPONENT_SEP ); } QueryKey(); QueryKey add( String property, Object value ); QueryKey add( Object value ); QueryKey addIgnoreNull( String property, Object value ); QueryKey addIgnoreNull( String property, Object object, Supplier<String> valueSupplier ); String asPlainKey(); String build(); @Override String toString();  }
@Test public void testAsPlainKey() { String key = new QueryKey() .add( "dimension", "dx" ) .add( "dimension", "pe" ) .add( "filter", "ou" ) .add( "aggregationType", AggregationType.SUM ) .add( "skipMeta", true ) .asPlainKey(); assertEquals( "dimension:dx-dimension:pe-filter:ou-aggregationType:SUM-skipMeta:true", key ); key = new QueryKey() .add( "dimension", "dx" ) .add( "filter", "pe" ) .add( "filter", "ou" ) .add( "aggregationType", AggregationType.AVERAGE ) .add( "skipMeta", true ) .asPlainKey(); assertEquals( "dimension:dx-filter:pe-filter:ou-aggregationType:AVERAGE-skipMeta:true", key ); }