private boolean equalTo(ImmutableCustomActionParameter another) { return name.equals(another.name) && value.equals(another.value) && type.equals(another.type); }
/** * Computes a hash code from attributes: {@code name}, {@code value}, {@code type}. * @return hashCode value */ @Override public int hashCode() { int h = 5381; h += (h << 5) + name.hashCode(); h += (h << 5) + value.hashCode(); h += (h << 5) + type.hashCode(); return h; }
public static ImmutableMappingParameter build(final Entry<?,?> parameterEntry){ final Object nameObject = parameterEntry.getKey(); if (!(nameObject instanceof String)) { return null; } final String name = nameObject.toString(); final Object mapObject = parameterEntry.getValue(); if (!(mapObject instanceof Map)) { return null; } final Map<?,?> map = (Map<?,?>)mapObject; final Object typeObject = map.get(TYPE_KEY); if (!(typeObject instanceof String)) { return null; } final Type type = Type.valueOf(typeObject.toString()); final Object valueObject = map.get(VALUE_KEY); if (!(valueObject instanceof String)) { return null; } final String value = valueObject.toString(); return new ImmutableMappingParameter(name, value, type); } }
public static void writeXML(final Document document, final Element currentElement, final CustomActionParameter customActionParameter) { final Element element = document.createElement(XML_CUSTOM_ACTION_PARAMETER_TAG); element.setAttribute(XML_NAME_ATT, customActionParameter.getName()); element.setAttribute(XML_TYPE_ATT, customActionParameter.getType().toString()); element.setAttribute(XML_VALUE_ATT, customActionParameter.getValue()); currentElement.appendChild(element); } }