package yuku.alkitab.model;

import yuku.alkitab.model.util.Gid;

public class Label implements Comparable<Label> {
	public static final String TAG = Label.class.getSimpleName();

	public long _id;
	public String gid;
	public String title;
	public int ordering;
	public String backgroundColor;

	private Label() {}

	@Override
	public int compareTo(Label another) {
		return this.ordering - another.ordering;
	}

	@Override
	public boolean equals(final Object o) {
		if (this == o) return true;
		if (!(o instanceof Label)) return false;

		final Label label = (Label) o;
		return _id == label._id;
	}

	/**
	 * Create without _id
	 */
	public static Label createNewLabel(String title, int ordering, String bgColor) {
		final Label res = new Label();

		res.gid = Gid.newGid();
		res.title = title;
		res.ordering = ordering;
		res.backgroundColor = bgColor;

		return res;
	}

	public static Label createEmptyLabel() {
		return new Label();
	}
}

@@ -410,198 +410,8 @@
 %09%7D%0A%0A
-%09@Override%0A%09public boolean equals(final Object o) %7B%0A%09%09if (this == o) return true;%0A%09%09if (!(o instanceof Label)) return false;%0A%0A%09%09final Label label = (Label) o;%0A%09%09return _id == label._id;%0A%09%7D%0A%0A
 %09/**

Remove faulty equals() method from Label