com.distelli.persistence.Attribute Maven / Gradle / Ivy
package com.distelli.persistence;
import java.util.Arrays;
import java.util.Objects;
public class Attribute {
protected String name = null;
protected Object value = null;
public Attribute()
{
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return this.name;
}
public Attribute withName(String name)
{
this.name = name;
return this;
}
public void setValue(Object value)
{
this.value = value;
}
public Object getValue()
{
return this.value;
}
public Attribute withValue(Object value)
{
this.value = value;
return this;
}
@Override
public String toString() {
return String.format("Attribute[name=%s, value=%s]", name, value);
}
@Override
public boolean equals(Object obj) {
if ( null == obj || ! getClass().equals(obj.getClass()) ) return false;
Attribute other = (Attribute)obj;
return Objects.deepEquals(name, other.name) &&
Objects.deepEquals(value, other.value);
}
@Override
public int hashCode() {
return Arrays.deepHashCode(new Object[]{name, value});
}
}