package com.springsource.samples.restlist; public class Bookmark implements Comparable<Bookmark> { private String key; private String name; private String description; private String url; public Bookmark() { } public Bookmark(String name, String description, String url) { this.name = name; this.description = description; this.url = url; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getKey() { return key; } void setKey(String key) { this.key = key; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((url == null) ? 0 : url.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Bookmark other = (Bookmark) obj; if (url == null) { if (other.url != null) return false; } else if (!url.equals(other.url)) return false; return true; } public int compareTo(Bookmark o) { return this.name.compareTo(o.name); } }