1:package is346; 2: 3:import java.io.Serializable; 4: 5:public class TrackDto 6: implements Serializable { 7: private Integer id; 8: private String title; 9: private Integer duration; 10: private ArtistDto[] artists; 11: public Integer getId() { 12: return id; 13: } 14: 15: public void setId(Integer id) { 16: this.id = id; 17: } 18: 19: public String getTitle() { 20: return title; 21: } 22: 23: public void setTitle(String title) { 24: this.title = title; 25: } 26: 27: public Integer getDuration() { 28: return duration; 29: } 30: 31: public void setDuration(Integer duration) { 32: this.duration = duration; 33: } 34: 35: public ArtistDto[] getArtists() { 36: return artists; 37: } 38: 39: public void setArtists(ArtistDto[] artists) { 40: this.artists = artists; 41: } 42: 43: public boolean equals(Object obj) { 44: if (this == obj) 45: return true; 46: if (! (obj instanceof TrackDto)) 47: return false; 48: TrackDto that = (TrackDto) obj; 49: if (! (that.id == null ? this.id == null : that.id.equals(this.id))) 50: return false; 51: if (! (that.title == null ? this.title == null : 52: that.title.equals(this.title))) 53: return false; 54: if (! (that.duration == null ? this.duration == null : 55: that.duration.equals(this.duration))) 56: return false; 57: return true; 58: } 59: 60: public int hashCode() { 61: int result = 17; 62: result = 37 * result + this.id.hashCode(); 63: result = 37 * result + this.title.hashCode(); 64: result = 37 * result + this.duration.hashCode(); 65: return result; 66: } 67: 68: public String toString() { 69: String returnString = ""; 70: returnString += id; 71: returnString += ", " + title; 72: returnString += ", " + duration; 73: return returnString; 74: } 75:}