use of org.springframework.shell.core.Converter in project geode by apache.
the class GfshParserConverterTest method spyConverter.
private static <T extends Converter> T spyConverter(Class<T> klass) {
Set<Converter<?>> converters = parser.getConverters();
T foundConverter = null, spy = null;
for (Converter converter : converters) {
if (klass.isAssignableFrom(converter.getClass())) {
foundConverter = (T) converter;
break;
}
}
if (foundConverter != null) {
parser.remove(foundConverter);
spy = spy(foundConverter);
parser.add(spy);
}
return spy;
}
Aggregations