view src/main/java/cl/maps/utils/RelKey.java @ 117:2db6271a0663

MigrateWitnessNotes now also migrates notes of CODEX and TEXT.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Tue, 27 Aug 2019 18:06:46 +0200
parents 615d27dce9b3
children
line wrap: on
line source

package cl.maps.utils;

import org.apache.commons.lang.StringUtils;

public class RelKey {
	
	private Long srcId;
	private Long tarId;
	private String relName;
	
	public RelKey(Long srcId, Long tarId, String relName){
		this.srcId = srcId;
		this.tarId = tarId;
		this.relName = relName;
	}
	public Long getSrcId() {
		return srcId;
	}
	public void setSrcId(Long srcId) {
		this.srcId = srcId;
	}
	public Long getTarId() {
		return tarId;
	}
	public void setTarId(Long tarId) {
		this.tarId = tarId;
	}
	public String getRelName() {
		return relName;
	}
	public void setRelName(String relName) {
		this.relName = relName;
	}
	
	@Override
    public int hashCode() {
		String s = this.srcId + "_" + this.tarId + "_" + relName;
		return s.hashCode();
	}	
	
	@Override
	public boolean equals(Object o){
		if(o instanceof RelKey){
			RelKey other = (RelKey)o;
			if(srcId.equals(other.srcId) &&
					tarId.equals(other.tarId) &&
					StringUtils.equals(relName, other.relName)){
				return true;
			}
		}
		return false;
	}
	

}