/** * Produce an {@link XmlEntity} with the supplied values. Builder is reset after {@link * #build()} is called. Subsequent calls will produce a new {@link XmlEntity}. * * <p>You are required to at least call {@link #withType(String)}. * * @return {@link XmlEntity} * @since 8.1 */ public XmlEntity build() { xmlEntity.init(); final XmlEntity built = xmlEntity; xmlEntity = new XmlEntity(); return built; }
/** * Construct a new XmlEntity while creating XML from the cache using the element which has a type * and attribute matching those given. * * @param type Type of the XML element to search for. Should be one of the constants from the * {@link CacheXml} class. For example, CacheXml.REGION. * @param key Key of the attribute to match, for example, "name" or "id". * @param value Value of the attribute to match. */ public XmlEntity(final String type, final String key, final String value) { this.type = type; this.attributes.put(key, value); init(); }