/** * Transforms the input to result via each decorated transformer * * @param object the input object passed to the first transformer * @return the transformed result */ public Object transform(Object object) { for (int i = 0; i < iTransformers.length; i++) { object = iTransformers[i].transform(object); } return object; }
/** * Transforms an object. * <p> * The transformer itself may throw an exception if necessary. * * @param object the object to transform * @return a transformed object */ protected Object transform(Object object) { return transformer.transform(object); }
/** * Override to transform the value when using <code>setValue</code>. * * @param value the value to transform * @return the transformed value * @since Commons Collections 3.1 */ protected Object checkSetValue(Object value) { return valueTransformer.transform(value); }
/** * Executes the closure by calling the decorated transformer. * * @param input the input object */ public void execute(Object input) { iTransformer.transform(input); }
/** * Transforms a key. * <p> * The transformer itself may throw an exception if necessary. * * @param object the object to transform * @throws the transformed object */ protected Object transformKey(Object object) { if (keyTransformer == null) { return object; } return keyTransformer.transform(object); }
/** * Override to transform the value when using <code>setValue</code>. * * @param value the value to transform * @return the transformed value * @since Commons Collections 3.1 */ protected Object checkSetValue(Object value) { return valueTransformer.transform(value); }
/** * Transforms the input to result via each decorated transformer * * @param object the input object passed to the first transformer * @return the transformed result */ public Object transform(Object object) { for (int i = 0; i < iTransformers.length; i++) { object = iTransformers[i].transform(object); } return object; }
/** * Transforms an object. * <p> * The transformer itself may throw an exception if necessary. * * @param object the object to transform * @return a transformed object */ protected Object transform(Object object) { return transformer.transform(object); }
/** * Transforms a value. * <p> * The transformer itself may throw an exception if necessary. * * @param object the object to transform * @throws the transformed object */ protected Object transformValue(Object object) { if (valueTransformer == null) { return object; } return valueTransformer.transform(object); }
/** * Transforms the given object using the transformer. * If the transformer is null, the original object is returned as-is. * * @param source the object to transform * @return the transformed object */ protected Object transform(Object source) { if (transformer != null) { return transformer.transform(source); } return source; } }
/** * Executes the closure by calling the decorated transformer. * * @param input the input object */ public void execute(Object input) { iTransformer.transform(input); }
/** * Transforms the given object using the transformer. * If the transformer is null, the original object is returned as-is. * * @param source the object to transform * @return the transformed object */ protected Object transform(Object source) { if (transformer != null) { return transformer.transform(source); } return source; } }
/** * Transforms a key. * <p> * The transformer itself may throw an exception if necessary. * * @param object the object to transform * @throws the transformed object */ protected Object transformKey(Object object) { if (keyTransformer == null) { return object; } return keyTransformer.transform(object); }
/** * Transforms a value. * <p> * The transformer itself may throw an exception if necessary. * * @param object the object to transform * @throws the transformed object */ protected Object transformValue(Object object) { if (valueTransformer == null) { return object; } return valueTransformer.transform(object); }
/** * Returns the result of comparing the values from the transform operation. * * @param obj1 the first object to transform then compare * @param obj2 the second object to transform then compare * @return negative if obj1 is less, positive if greater, zero if equal */ public int compare(Object obj1, Object obj2) { Object value1 = this.transformer.transform(obj1); Object value2 = this.transformer.transform(obj2); return this.decorated.compare(value1, value2); }
/** * Returns the result of comparing the values from the transform operation. * * @param obj1 the first object to transform then compare * @param obj2 the second object to transform then compare * @return negative if obj1 is less, positive if greater, zero if equal */ public int compare(Object obj1, Object obj2) { Object value1 = this.transformer.transform(obj1); Object value2 = this.transformer.transform(obj2); return this.decorated.compare(value1, value2); }
public Object get(Object key) { // create value for key if key is not currently in the map if (map.containsKey(key) == false) { if (value instanceof Transformer) { return ((Transformer) value).transform(key); } return value; } return map.get(key); }
public Object get(Object key) { // create value for key if key is not currently in the map if (map.containsKey(key) == false) { Object value = factory.transform(key); map.put(key, value); return value; } return map.get(key); }
public Object get(Object key) { // create value for key if key is not currently in the map if (map.containsKey(key) == false) { if (value instanceof Transformer) { return ((Transformer) value).transform(key); } return value; } return map.get(key); }
/** * Transforms the input to result by calling the transformer whose matching * predicate returns true. * * @param input the input object to transform * @return the transformed result */ public Object transform(Object input) { for (int i = 0; i < iPredicates.length; i++) { if (iPredicates[i].evaluate(input) == true) { return iTransformers[i].transform(input); } } return iDefault.transform(input); }