package org.springframework.content.s3;

import java.io.Serializable;

public final class S3ContentId implements Serializable {
    private String bucket;
    private String objectId;

    public S3ContentId(String bucket, String objectId) {
        this.bucket = bucket;
        this.objectId = objectId;
    }

    public String getBucket() {
        return bucket;
    }

    public void setBucket(String bucket) {
        this.bucket = bucket;
    }

    public String getObjectId() {
        return objectId;
    }

    public void setObjectId(String objectId) {
        this.objectId = objectId;
    }

    @Override
    public String toString() {
        return "S3ContentId{" +
                "bucket='" + bucket + '\'' +
                ", objectId='" + objectId + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        S3ContentId that = (S3ContentId) o;

        if (bucket != null ? !bucket.equals(that.bucket) : that.bucket != null) return false;
        return objectId != null ? objectId.equals(that.objectId) : that.objectId == null;
    }

    @Override
    public int hashCode() {
        int result = bucket != null ? bucket.hashCode() : 0;
        result = 31 * result + (objectId != null ? objectId.hashCode() : 0);
        return result;
    }
}

@@ -34,16 +34,57 @@
 nt.s3;%0A%0A
+import org.springframework.util.Assert;%0A%0A
 import j
@@ -268,32 +268,156 @@
 ing objectId) %7B%0A
+        Assert.hasText(bucket, %22bucket must be specified%22);%0A        Assert.hasText(objectId, %22objectId must be specified%22);%0A
         this.buc

Add assertions to ensure only valid s3content ids can be created