diff options
Diffstat (limited to 'core/java/android/print/PrintDocumentInfo.java')
-rw-r--r-- | core/java/android/print/PrintDocumentInfo.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/java/android/print/PrintDocumentInfo.java b/core/java/android/print/PrintDocumentInfo.java index 7d42b3a..29e8e7c 100644 --- a/core/java/android/print/PrintDocumentInfo.java +++ b/core/java/android/print/PrintDocumentInfo.java @@ -111,6 +111,36 @@ public final class PrintDocumentInfo implements Parcelable { } @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + mContentType; + result = prime * result + mPageCount; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + PrintDocumentInfo other = (PrintDocumentInfo) obj; + if (mContentType != other.mContentType) { + return false; + } + if (mPageCount != other.mPageCount) { + return false; + } + return true; + } + + @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("PrintDocumentInfo{"); |