view src/main/java/cl/maps/utils/AttKey.java @ 33:e52f593f9e0d

new transaction logger "openmind.transactionlog" logging entity save actions and their data. more comments in code.
author casties
date Fri, 26 Aug 2016 11:42:41 +0200
parents 615d27dce9b3
children
line wrap: on
line source

package cl.maps.utils;

import org.apache.commons.lang.StringUtils;

public class AttKey{
	private String oc;
	private String attName;
	
	public AttKey(String oc, String attName){
		this.oc = oc;
		this.attName = attName;
	}

	public String getOc() {
		return oc;
	}

	public void setOc(String oc) {
		this.oc = oc;
	}

	public String getAttName() {
		return attName;
	}

	public void setAttName(String attName) {
		this.attName = attName;
	}
	
	@Override
    public int hashCode() {
		String s = this.oc + this.attName;
		return s.hashCode();
	}
	
	@Override
	public boolean equals(Object o){
		if(o instanceof AttKey){
			AttKey other = (AttKey)o;
			if(StringUtils.equals(oc, other.oc) &&
					StringUtils.equals(attName, other.attName)){
				return true;
			}
		}
		return false;
	}
	
	@Override
	public String toString(){
		return "AttKey [" + oc + ", " + attName + "]";
	}
	
}