com.composum.platform.models.simple.ViewValueMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of composum-platform-models-bundle Show documentation
Show all versions of composum-platform-models-bundle Show documentation
Bundle containing features for the general use of Models incl. Sling-Models bundled as a
package
The newest version!
package com.composum.platform.models.simple;
import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.wrappers.ValueMapDecorator;
import java.util.Map;
public class ViewValueMap extends ValueMapDecorator {
public ViewValueMap(Map base) {
super(base);
}
/**
* assuming the Map.get() is used in templates a multi value is joined to a String
*/
@Override
public Object get(Object key) {
Object value = super.get(key);
return value instanceof Object[] ? StringUtils.join((Object[]) value, ", ") : value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy