@Test public void testTransform() { OrdinalTransformer ord = new OrdinalTransformer(); TargetValueObject t1 = new TargetValueObject(); t1.setValue(1.4); TargetValueObject t2 = new TargetValueObject(); t2.setValue(2.4); TargetValueObject t3 = new TargetValueObject(); t3.setValue(3.2); Map<String,TargetValueObject> map = new HashMap<String,TargetValueObject>(); map.put("GOOD", t1); map.put("BAD", t2); map.put("HORRIBLE", t3); ord.setMapping(map); OrdinalValue value = new OrdinalValue(); value.setValue("GOOD"); TargetValue r = ord.transform(value); Assert.assertTrue(r.getValue()==1.4); }
public TargetValue transform(INumericValue v) { throw new UnsupportedOperationException("Cannot transform numeric values. only ordinal ones!"); }
OrdinalTransformer extends Transformer { public TargetValue transform(INumericValue v) { throw new UnsupportedOperationException("Cannot transform numeric values. only ordinal ones!"); } }
OrdinalTransformer extends Transformer { public TargetValue transform(INumericValue v) { throw new UnsupportedOperationException("Cannot transform numeric values. only ordinal ones!"); }  }
OrdinalTransformer extends Transformer { public TargetValue transform(INumericValue v) { throw new UnsupportedOperationException("Cannot transform numeric values. only ordinal ones!"); }  Map<String, TargetValueObject> getMapping(); void setMapping(Map<String, TargetValueObject> mapping); TargetValue transform(INumericValue v); TargetValue transform(IOrdinalValue v); boolean isTransformable(List<ValidationError> errors); @Override Transformer clone(); }
OrdinalTransformer extends Transformer { public TargetValue transform(INumericValue v) { throw new UnsupportedOperationException("Cannot transform numeric values. only ordinal ones!"); }  Map<String, TargetValueObject> getMapping(); void setMapping(Map<String, TargetValueObject> mapping); TargetValue transform(INumericValue v); TargetValue transform(IOrdinalValue v); boolean isTransformable(List<ValidationError> errors); @Override Transformer clone();  }