/*
 * Copyright 2014 A.C.R. Development
 */
package acr.browser.lightning;

import android.graphics.Bitmap;

public class HistoryItem implements Comparable<HistoryItem> {

	// private variables
	private int mId;

	private String mUrl;

	private String mTitle;

	private Bitmap mBitmap;

	private int mImageId;

	// Empty constructor
	public HistoryItem() {

	}

	// constructor
	public HistoryItem(int id, String url, String title) {
		this.mId = id;
		this.mUrl = url;
		this.mTitle = title;
		this.mBitmap = null;
	}

	// constructor
	public HistoryItem(String url, String title) {
		this.mUrl = url;
		this.mTitle = title;
		this.mBitmap = null;
	}

	// constructor
	public HistoryItem(String url, String title, int imageId) {
		this.mUrl = url;
		this.mTitle = title;
		this.mBitmap = null;
		this.mImageId = imageId;
	}

	// getting ID
	public int getId() {
		return this.mId;
	}

	public int getImageId() {
		return this.mImageId;
	}

	// setting id
	public void setID(int id) {
		this.mId = id;
	}

	public void setImageId(int id) {
		this.mImageId = id;
	}

	public void setBitmap(Bitmap image) {
		mBitmap = image;
	}

	public Bitmap getBitmap() {
		return mBitmap;
	}

	// getting name
	public String getUrl() {
		return this.mUrl;
	}

	// setting name
	public void setUrl(String url) {
		this.mUrl = url;
	}

	// getting phone number
	public String getTitle() {
		return this.mTitle;
	}

	// setting phone number
	public void setTitle(String title) {
		this.mTitle = title;
	}

	@Override
	public String toString() {
		return mTitle;
	}

	@Override
	public int compareTo(HistoryItem another) {
		return mTitle.compareTo(another.mTitle);
	}
}

@@ -1643,11 +1643,827 @@
 tle);%0A%09%7D
+%0A%0A%09@Override%0A%09public boolean equals(Object o) %7B%0A%0A%09%09if (this == o) %7B%0A%09%09%09return true;%0A%09%09%7D%0A%09%09if (o == null %7C%7C ((Object) this).getClass() != o.getClass()) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%0A%09%09HistoryItem that = (HistoryItem) o;%0A%0A%09%09if (mId != that.mId) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09if (mImageId != that.mImageId) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09if (mBitmap != null ? !mBitmap.equals(that.mBitmap) : that.mBitmap != null) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09if (!mTitle.equals(that.mTitle)) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09if (!mUrl.equals(that.mUrl)) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%0A%09%09return true;%0A%09%7D%0A%0A%09@Override%0A%09public int hashCode() %7B%0A%0A%09%09int result = mId;%0A%09%09result = 31 * result + mUrl.hashCode();%0A%09%09result = 31 * result + mTitle.hashCode();%0A%09%09result = 31 * result + (mBitmap != null ? mBitmap.hashCode() : 0);%0A%09%09result = 31 * result + mImageId;%0A%0A%09%09return result;%0A%09%7D
 %0A%7D%0A

Add missing equals() and hashCode() methods for class that implements Comparable<T>