package de.ugoe.cs.swe.memos.datamodel;

public class Tag {

	private Long iD;
	private String name;
	private Long memoID;
	
	public Long getMemoID() {
		return memoID;
	}

	public void setMemoID(Long memoID) {
		this.memoID = memoID;
	}

	public Tag(String name, Memo memo) {
		this.name = name;
		this.memo = memo;
		this.memo.getTags().add(this);
	}

	public Tag(String name) {
		this.name = name;
	}

	private Memo memo;

	public Long getiD() {
		return iD;
	}

	public void setiD(Long iD) {
		this.iD = iD;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Memo getMemo() {
		return memo;
	}

	public void setMemo(Memo memo) {
		this.memo = memo;
	}
	
	public boolean equals(Object o)
	{	try{
			Tag t=(Tag)o;
			return t.getName().equals(this.getName());	
		}
		catch(Exception e)
		{
			return false;
		}
		
	}
}
