Java Code Examples for org.apache.commons.collections.CollectionUtils#transform()

The following examples show how to use org.apache.commons.collections.CollectionUtils#transform() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IDVO.java    From ctsms with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void transformVoCollection(Collection<?> vos) {
	if (vos != null) {
		CollectionUtils.transform(vos, new Transformer() {

			@Override
			public Object transform(Object input) {
				return transformVo(input);
			}
		});
	}
}
 
Example 2
Source File: IDVO.java    From ctsms with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static void transformVoCollection(Collection<?> vos, VOTransformation transformation) {
	if (vos != null) {
		CollectionUtils.transform(vos, new Transformer() {

			@Override
			public Object transform(Object input) {
				return transformVo(input, transformation);
			}
		});
	}
}
 
Example 3
Source File: NoShortcutSerializationWrapper.java    From ctsms with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static <T> void  transformVoCollection(Collection<T> vos) {
	if (vos != null) {
		CollectionUtils.transform(vos, new Transformer() {

			@Override
			public Object transform(Object input) {
				return new NoShortcutSerializationWrapper((Serializable) input);
			}
		});
	}
}
 
Example 4
Source File: SeperateExecutionCourseDispatchAction.java    From fenixedu-academic with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void transformExecutionDegreesIntoLabelValueBean(List executionDegreeList) {
    CollectionUtils.transform(executionDegreeList, new Transformer() {

        @Override
        public Object transform(Object arg0) {
            InfoExecutionDegree infoExecutionDegree = (InfoExecutionDegree) arg0;
            /*
            TODO: DUPLICATE check really needed?
            StringBuilder label =
                    new StringBuilder(infoExecutionDegree.getInfoDegreeCurricularPlan().getInfoDegree().getDegreeType()
                            .getLocalizedName());
            label.append(" em ");
            label.append(infoExecutionDegree.getInfoDegreeCurricularPlan().getInfoDegree().getNome());
            */

            String label =
                    infoExecutionDegree.getInfoDegreeCurricularPlan().getDegreeCurricularPlan()
                            .getPresentationName(infoExecutionDegree.getInfoExecutionYear().getExecutionYear());

            return new LabelValueBean(label, infoExecutionDegree.getExternalId().toString());
        }

    });

    Collections.sort(executionDegreeList, new BeanComparator("label"));
    executionDegreeList.add(0, new LabelValueBean(BundleUtil.getString(Bundle.RENDERER, "renderers.menu.default.title"), ""));
}