/* * Constellation - An open source and standard compliant SDI * http://www.constellation-sdi.org * * Copyright 2014 Geomatys. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.constellation.configuration; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import java.util.Objects; /** * Parameter key/value based for GetFeatureInfoCfg. * * @author Quentin Boileau (Geomatys) * @since 0.9 */ @XmlAccessorType(XmlAccessType.FIELD) public class GFIParam { @XmlAttribute private String key; @XmlAttribute private String value; public GFIParam() { } public GFIParam(String key, String value) { this.key = key; this.value = value; } public String getKey() { return key; } public String getValue() { return value; } @Override public String toString() { final StringBuilder sb = new StringBuilder("[GFIParam]"); if (key != null) { sb.append("key:").append(key); } if (value != null) { sb.append(" value:").append(value).append('\n'); } return sb.toString(); } @Override public boolean equals(final Object obj) { if (obj instanceof GFIParam) { final GFIParam that = (GFIParam) obj; return Objects.equals(this.key, that.key) && Objects.equals(this.value, that.value); } return false; } @Override public int hashCode() { int hash = 7; hash = 79 * hash + (this.key != null ? this.key.hashCode() : 0); hash = 79 * hash + (this.value != null ? this.value.hashCode() : 0); return hash; } }