Created
November 26, 2011 03:02
-
-
Save casidiablo/1394886 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.simpleframework.xml.*; | |
@Root(name = "link") | |
@Default(DefaultType.FIELD) | |
public class Link { | |
public static final String ID = "id"; | |
public static final String TYPE = "type"; | |
@Text(required = true) | |
private String id; | |
@Attribute(name = "type", required = true) | |
private String type; | |
public String getId() { | |
return id; | |
} | |
public void setId(String id) { | |
this.id = id; | |
} | |
public String getType() { | |
return type; | |
} | |
public void setType(String type) { | |
this.type = type; | |
} | |
@Override | |
public boolean equals(Object o) { | |
if (this == o) return true; | |
if (o == null || getClass() != o.getClass()) return false; | |
Link link = (Link) o; | |
if (id != null ? !id.equals(link.id) : link.id != null) return false; | |
if (type != null ? !type.equals(link.type) : link.type != null) return false; | |
return true; | |
} | |
@Override | |
public int hashCode() { | |
int result = id != null ? id.hashCode() : 0; | |
result = 31 * result + (type != null ? type.hashCode() : 0); | |
return result; | |
} | |
@Override | |
public String toString() { | |
return "Link{" + | |
"id='" + id + '\'' + | |
", type='" + type + '\'' + | |
'}'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment