package base.interfaces;

import java.io.InputStream;

/**
 * Defines the base unit of generic "data" for sending and receiving.
 */
public interface IItem {
	
	/**
	 * Represents the content's stream as a String.
	 * 
	 * NOTE: The data's InputStream may not be consumable after this
	 * 
	 * @return String represents the data as a String
	 */
	public String getContentString();
	
	/**
	 * Sets the String that represents this data.
	 * 
	 * @param data is the String that represents this data
	 */
	public void setContentString(String data);
	
	/**
	 * Returns the raw InputStream of the data.
	 * 
	 * @return InputStream is the data's InputStream
	 */
	public InputStream getContent();
	
	/**
	 * Sets the InputStream which defines this data.
	 * 
	 * @param stream is the InputStream to define the data
	 */
	public void setContent(InputStream stream);
	
	/**
	 * Indicates this data's Content-Type.
	 * 
	 * @return String defines this data's Content-Type.
	 */
	public String getContentType();
	
	/**
	 * Sets the Content-Type of this data.
	 * 
	 * @param type is this data's Content-Type
	 */
	public void setContentType(String type);
	
	/**
	 * Indicates this data's Content-Encoding.
	 * 
	 * @return String defines this data's Content-Encoding.
	 */
	public String getContentEncoding();
	
	/**
	 * Sets the Content-Encoding of this data.
	 * 
	 * @param encoding indicates the data's encoding
	 */
	public void setContentEncoding(String encoding);
	
	/**
	 * Indicates the length of the data.
	 * 
	 * @return long indicates the length of the data
	 */
	public long getContentLength();
	
	/**
	 * Sets the Content-Length of this data.
	 * 
	 * @param length is the data's length
	 */
	public void setContentLength(long length);
}
