ConversionContext { public Map<String, String> getMeta() { Map<String, String> metaMap = new HashMap<>(); if(configuration!=null){ metaMap.putAll(configuration.getContext().getMetaData(key)); } for(PropertyValue val:values){ if(key.equals(val.getQualifiedKey())){ metaMap.putAll(val.getMeta()); } } return metaMap; } protected  ConversionContext(Builder builder); String getKey(); List<PropertyValue> getValues(); TypeLiteral<?> getTargetType(); AnnotatedElement getAnnotatedElement(); Configuration getConfiguration(); Map<String, String> getMeta(); void addSupportedFormats(@SuppressWarnings("rawtypes") Class<?> converterType, String... formatDescriptors); List<String> getSupportedFormats(); Builder toBuilder(); @Override String toString(); @Deprecated ConfigurationContext getConfigurationContext(); static final ConversionContext EMPTY; }
@Test public void testGetMeta(){ ConversionContext ctx = new ConversionContext.Builder("test", TypeLiteral.of(List.class)) .addSupportedFormats(MyConverter.class, "0.0.0.0/nnn", "x.x.x.x/yyy") .setValues(new PropertyValue("test", "value") .setMeta("meta1", "val1").setMeta("meta2", "val2")).build(); assertThat(ctx.getMeta()).isNotNull().isNotEmpty().hasSize(2); }