001/*
002 * Copyright (c) 2012, the Last.fm Java Project and Committers
003 * All rights reserved.
004 *
005 * Redistribution and use of this software in source and binary forms, with or without modification, are
006 * permitted provided that the following conditions are met:
007 *
008 * - Redistributions of source code must retain the above
009 *   copyright notice, this list of conditions and the
010 *   following disclaimer.
011 *
012 * - Redistributions in binary form must reproduce the above
013 *   copyright notice, this list of conditions and the
014 *   following disclaimer in the documentation and/or other
015 *   materials provided with the distribution.
016 *
017 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
018 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
019 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
020 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
021 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
022 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
023 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
024 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
025 */
026package de.umass.lastfm.scrobble;
027
028import de.umass.lastfm.Result;
029
030/**
031 * Result object which contains extra information returned by scrobble and now playing requests.
032 *
033 * @author Adrian Woodhead
034 */
035public class ScrobbleResult extends Result {
036
037        private String track;
038        private String artist;
039        private String album;
040        private String albumArtist;
041        private int timestamp;
042        private boolean trackCorrected;
043        private boolean artistCorrected;
044        private boolean albumCorrected;
045        private boolean albumArtistCorrected;
046        private boolean ignored;
047        private IgnoredMessageCode ignoredMessageCode;
048        private String ignoredMessage;
049
050        public ScrobbleResult(Result result) {
051                super(result.getResultDocument());
052                super.status = result.getStatus();
053                super.errorMessage = result.getErrorMessage();
054                super.errorCode = result.getErrorCode();
055                super.httpErrorCode = result.getHttpErrorCode();
056        }
057
058        public String getTrack() {
059                return track;
060        }
061
062        public void setTrack(String track) {
063                this.track = track;
064        }
065
066        public String getArtist() {
067                return artist;
068        }
069
070        public void setArtist(String artist) {
071                this.artist = artist;
072        }
073
074        public String getAlbum() {
075                return album;
076        }
077
078        public void setAlbum(String album) {
079                this.album = album;
080        }
081
082        public String getAlbumArtist() {
083                return albumArtist;
084        }
085
086        public void setAlbumArtist(String albumArtist) {
087                this.albumArtist = albumArtist;
088        }
089
090        public long getTimestamp() {
091                return timestamp;
092        }
093
094        public void setTimestamp(int timestamp) {
095                this.timestamp = timestamp;
096        }
097
098        public boolean isTrackCorrected() {
099                return trackCorrected;
100        }
101
102        public void setTrackCorrected(boolean trackCorrected) {
103                this.trackCorrected = trackCorrected;
104        }
105
106        public boolean isArtistCorrected() {
107                return artistCorrected;
108        }
109
110        public void setArtistCorrected(boolean artistCorrected) {
111                this.artistCorrected = artistCorrected;
112        }
113
114        public boolean isAlbumCorrected() {
115                return albumCorrected;
116        }
117
118        public void setAlbumCorrected(boolean albumCorrected) {
119                this.albumCorrected = albumCorrected;
120        }
121
122        public boolean isAlbumArtistCorrected() {
123                return albumArtistCorrected;
124        }
125
126        public void setAlbumArtistCorrected(boolean albumArtistCorrected) {
127                this.albumArtistCorrected = albumArtistCorrected;
128        }
129
130        public boolean isIgnored() {
131                return ignored;
132        }
133
134        public void setIgnored(boolean ignored) {
135                this.ignored = ignored;
136        }
137
138        public IgnoredMessageCode getIgnoredMessageCode() {
139                return ignoredMessageCode;
140        }
141
142        public void setIgnoredMessageCode(IgnoredMessageCode ignoredMessageCode) {
143                this.ignoredMessageCode = ignoredMessageCode;
144        }
145
146        public String getIgnoredMessage() {
147                return ignoredMessage;
148        }
149
150        public void setIgnoredMessage(String ignoredMessage) {
151                this.ignoredMessage = ignoredMessage;
152        }
153
154        /*
155         * (non-Javadoc)
156         *
157         * @see java.lang.Object#toString()
158         */
159
160        @Override
161        public String toString() {
162                return "ScrobbleResult [" + super.toString() + ", track=" + track + ", trackCorrected=" + trackCorrected + ", artist=" + artist
163                                + ", artistCorrected=" + artistCorrected + ", album=" + album + ", albumCorrected=" + albumCorrected + ", albumArtist="
164                                + albumArtist + ", albumArtistCorrected=" + albumArtistCorrected + ", ignored=" + ignored + ", ignoredMessageCode="
165                                + ignoredMessageCode + ", ignoredMessage=" + ignoredMessage + ", timestamp=" + timestamp + "]";
166        }
167
168}