/**
* Copyright 2011 Intuit Inc. All Rights Reserved
*/
package com.intuit.tank.reporting.databases;
/*
* #%L
* Reporting API
* %%
* 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 java.io.Serializable;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
/**
* Attribute
*
* @author dangleton
*
*/
public class Attribute implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private String value;
/**
*
*/
public Attribute() {
super();
}
/**
* @param name
* @param value
*/
public Attribute(String name, String value) {
super();
this.name = name;
this.value = value;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the value
*/
public String getValue() {
return value;
}
/**
* @param value
* the value to set
*/
public void setValue(String value) {
this.value = value;
}
/**
* @{inheritDoc
*/
@Override
public String toString() {
return name + " = " + value;
}
/**
* @{inheritDoc
*/
@Override
public int hashCode() {
return new HashCodeBuilder(13, 49).append(name).append(value).toHashCode();
}
/**
* @{inheritDoc
*/
@Override
public boolean equals(Object obj) {
if (obj != null && obj instanceof Attribute) {
Attribute o = (Attribute) obj;
return new EqualsBuilder().append(name, o.name).append(value, o.value).isEquals();
}
return false;
}
}