package org.gcube.portlets.widgets.ckandatapublisherwidget.shared.metadata; /** * Specifies the action to take when a tag or a group must be created from a field. * @see org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.TaggingGroupingValue * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) */ public enum TaggingGroupingValue { onFieldName, onValue, onFieldName_onValue, onValue_onFieldName; /** * Returns the composed value * @param name * @param value * @param separator * @param action * @return */ public static String getComposedValue(String name, String value, String separator, TaggingGroupingValue action){ switch(action){ case onFieldName: return name; case onValue: return value; case onFieldName_onValue: return name + separator + value; case onValue_onFieldName: return value + separator + name; default: return null; } } }