Content.java

/*
 * Copyright 2018 Global Crop Diversity Trust
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.genesys.filerepository.service.s3;

import java.util.Date;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;

/**
 * <p>
 * Metadata about each object.
 * </p>
 *
 * <pre>
&lt;Contents&gt;
    &lt;Key&gt;my-image.jpg&lt;/Key&gt;
    &lt;LastModified&gt;2009-10-12T17:50:30.000Z&lt;/LastModified&gt;
    &lt;ETag&gt;&quot;fba9dede5f27731c9771645a39863328&quot;&lt;/ETag&gt;
    &lt;Size&gt;434234&lt;/Size&gt;
    &lt;StorageClass&gt;STANDARD&lt;/StorageClass&gt;
    &lt;Owner&gt;
        &lt;ID&gt;75aa57f09aa0c8caeab4f8c24e99d10f8e7faeebf76c078efc7c6caea54ba06a&lt;/ID&gt;
        &lt;DisplayName&gt;mtd@amazon.com&lt;/DisplayName&gt;
    &lt;/Owner&gt;
&lt;/Contents&gt;
 * </pre>
 */
@XmlAccessorType(XmlAccessType.NONE)
public class Content {
	/**
	 * The object's key.
	 */
	@XmlElement(name = "Key")
	private String key;
	/**
	 * Date and time the object was last modified.
	 */
	@XmlElement(name = "LastModified")
	private Date lastModified;
	/**
	 * The entity tag is an MD5 hash of the object. The ETag only reflects changes
	 * to the contents of an object, not its metadata.
	 */
	@XmlElement(name = "ETag")
	private String etag;

	/**
	 * Size in bytes of the object.
	 */
	@XmlElement(name = "Size")
	private long size;

	/** STANDARD | STANDARD_IA | REDUCED_REDUNDANCY | GLACIER. */
	@XmlElement(name = "StorageClass")
	private String storageClass;

	/**
	 * Bucket owner.
	 */
	@XmlElement(name = "Owner")
	private Owner owner;

	/**
	 * Gets the key.
	 *
	 * @return the key
	 */
	public String getKey() {
		return key;
	}

	/**
	 * Sets the key.
	 *
	 * @param key the key to set
	 */
	public void setKey(final String key) {
		this.key = key;
	}

	/**
	 * Gets the last modified.
	 *
	 * @return the lastModified
	 */
	public Date getLastModified() {
		return lastModified;
	}

	/**
	 * Sets the last modified.
	 *
	 * @param lastModified the lastModified to set
	 */
	public void setLastModified(final Date lastModified) {
		this.lastModified = lastModified;
	}

	/**
	 * Gets the etag.
	 *
	 * @return the etag
	 */
	public String getEtag() {
		return etag;
	}

	/**
	 * Sets the etag.
	 *
	 * @param etag the etag to set
	 */
	public void setEtag(final String etag) {
		this.etag = etag;
	}

	/**
	 * Gets the size.
	 *
	 * @return the size
	 */
	public long getSize() {
		return size;
	}

	/**
	 * Sets the size.
	 *
	 * @param size the size to set
	 */
	public void setSize(final long size) {
		this.size = size;
	}

	/**
	 * Gets the storage class.
	 *
	 * @return the storageClass
	 */
	public String getStorageClass() {
		return storageClass;
	}

	/**
	 * Sets the storage class.
	 *
	 * @param storageClass the storageClass to set
	 */
	public void setStorageClass(final String storageClass) {
		this.storageClass = storageClass;
	}

	/**
	 * Gets the owner.
	 *
	 * @return the owner
	 */
	public Owner getOwner() {
		return owner;
	}

	/**
	 * Sets the owner.
	 *
	 * @param owner the owner to set
	 */
	public void setOwner(final Owner owner) {
		this.owner = owner;
	}
}