|
| 1 | +package fr.free.nrw.commons.mwapi; |
| 2 | + |
| 3 | +import android.support.annotation.NonNull; |
| 4 | +import android.support.annotation.Nullable; |
| 5 | + |
| 6 | +public class UploadStash { |
| 7 | + @NonNull |
| 8 | + private String errorCode; |
| 9 | + @NonNull |
| 10 | + private String resultStatus; |
| 11 | + @NonNull |
| 12 | + private String filename; |
| 13 | + @NonNull |
| 14 | + private String filekey; |
| 15 | + |
| 16 | + @NonNull |
| 17 | + public final String getErrorCode() { |
| 18 | + return this.errorCode; |
| 19 | + } |
| 20 | + |
| 21 | + @NonNull |
| 22 | + public final String getResultStatus() { |
| 23 | + return this.resultStatus; |
| 24 | + } |
| 25 | + |
| 26 | + @NonNull |
| 27 | + public final String getFilename() { |
| 28 | + return this.filename; |
| 29 | + } |
| 30 | + |
| 31 | + @NonNull |
| 32 | + public final String getFilekey() { |
| 33 | + return this.filekey; |
| 34 | + } |
| 35 | + |
| 36 | + public UploadStash(@NonNull String errorCode, @NonNull String resultStatus, @NonNull String filename, @NonNull String filekey) { |
| 37 | + this.errorCode = errorCode; |
| 38 | + this.resultStatus = resultStatus; |
| 39 | + this.filename = filename; |
| 40 | + this.filekey = filekey; |
| 41 | + } |
| 42 | + |
| 43 | + public String toString() { |
| 44 | + return "UploadStash(errorCode=" + this.errorCode + ", resultStatus=" + this.resultStatus + ", filename=" + this.filename + ", filekey=" + this.filekey + ")"; |
| 45 | + } |
| 46 | + |
| 47 | + public int hashCode() { |
| 48 | + return ((this.errorCode.hashCode() * 31 + this.resultStatus.hashCode() |
| 49 | + ) * 31 + this.filename.hashCode() |
| 50 | + ) * 31 + this.filekey.hashCode(); |
| 51 | + } |
| 52 | + |
| 53 | + public boolean equals(@Nullable Object obj) { |
| 54 | + if (this != obj) { |
| 55 | + if (obj instanceof UploadStash) { |
| 56 | + UploadStash that = (UploadStash)obj; |
| 57 | + if (this.errorCode.equals(that.errorCode) |
| 58 | + && this.resultStatus.equals(that.resultStatus) |
| 59 | + && this.filename.equals(that.filename) |
| 60 | + && this.filekey.equals(that.filekey)) { |
| 61 | + return true; |
| 62 | + } |
| 63 | + } |
| 64 | + |
| 65 | + return false; |
| 66 | + } else { |
| 67 | + return true; |
| 68 | + } |
| 69 | + } |
| 70 | +} |
0 commit comments