package com.intuit.tank.harness.data;
/*
* #%L
* Harness Data
* %%
* Copyright (C) 2011 - 2015 Intuit Inc.
* %%
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* #L%
*/
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
@XmlType(name = "data", propOrder = { "key", "value", "action" }, namespace = HarnessDataNamespace.NAMESPACE_V1)
@XmlAccessorType(XmlAccessType.FIELD)
public class Header {
@XmlElement(name = "name")
private String key;
@XmlElement(name = "value")
private String value;
@XmlAttribute(name = "action")
private String action = "add";
/**
* @return the key
*/
public String getKey() {
return key;
}
/**
* @param key
* the key to set
*/
public void setKey(String key) {
this.key = key;
}
/**
* @return the value
*/
public String getValue() {
return value;
}
/**
* @param value
* the value to set
*/
public void setValue(String value) {
this.value = value;
}
/**
* @return the action
*/
public String getAction() {
return action;
}
/**
* @param action
* the action to set
*/
public void setAction(String action) {
this.action = action;
}
@Override
public int hashCode() {
return new HashCodeBuilder(29, 45).append(getKey()).toHashCode();
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Header)) {
return false;
}
Header o = (Header) obj;
return new EqualsBuilder().append(o.getKey(), getKey()).isEquals();
}
}