sclass InputProcessor1 { new Map> propertyMakers; class Out > PropertiesAndErrors { S input; O getProperty(S name) { if (properties.containsKey(name)) ret properties.get(name); if (propertyErrors.containsKey(name)) throw throwPersistableThrowable(propertyErrors.get(name)); O f = propertyMakers.get(name); if (f == null) null; callFAndPutInResultOrErrorMap(properties, propertyErrors, input, f, input); if (propertyErrors.containsKey(name)) throw throwPersistableThrowable(propertyErrors.get(name)); ret properties.get(name); } } Out process(S input) { Out out = nu(+input); for (S name, O f : propertyMakers) callFAndPutInResultOrErrorMap(out.properties, out.propertyErrors, input, f, input); ret out; } // you can query properties on demand Out dontProcess(S input) { ret nu Out(+input); } }