1 // Copyright 2009 Google Inc. All rights reserved.
3 package com
.google
.appengine
.api
.blobstore
;
5 import java
.io
.Serializable
;
8 * {@code BlobKey} contains the string identifier of a large (possibly
9 * larger than 1MB) blob of binary data that was uploaded in a
10 * previous request and can be streamed directly to users.
13 public final class BlobKey
implements Serializable
, Comparable
<BlobKey
> {
14 private final String blobKey
;
17 * Construct a new {@code BlobKey} with the specified key string.
19 * @throws IllegalArgumentException If the specified string was null.
21 public BlobKey(String blobKey
) {
22 if (blobKey
== null) {
23 throw new IllegalArgumentException("Argument must not be null.");
25 this.blobKey
= blobKey
;
29 * Returns the blob key as a String.
31 public String
getKeyString() {
36 public int hashCode() {
37 return blobKey
.hashCode();
41 * Two {@code BlobKey} objects are considered equal if they point
45 public boolean equals(Object object
) {
46 if (object
instanceof BlobKey
) {
47 BlobKey key
= (BlobKey
) object
;
48 return key
.blobKey
.equals(blobKey
);
54 public String
toString() {
55 return "<BlobKey: " + blobKey
+ ">";
58 public int compareTo(BlobKey o
) {
59 return blobKey
.compareTo(o
.blobKey
);