All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nyla.solutions.core.data.Envelope Maven / Gradle / Ivy

Go to download

This Java API provides support for application utilities (application configuration, data encryption, debugger, text processing, and more).

The newest version!
package nyla.solutions.core.data;

import java.io.Serializable;
import java.util.Map;

/**
 * This object encapsulates a request and response.
 * @author Gregory Green
 * @param   the payload type
 * @version 1.0
 *
 */
public class Envelope implements Serializable
{
	private static final long serialVersionUID = 543197843593634035L;

	private Map header = null;
	private PayloadType payload  = null;

	/**
	 * Default constructor
	 */
	public Envelope()
	{}

	/**
	 * Default constructor
	 * @param payload the payload
	 */
	public Envelope(PayloadType payload)
	{
		this.payload = payload;
	}

	/**
	 * Create with header and payload
	 * @param header the envelope header
	 * @param payload the payload
	 */
	public Envelope(Map header, PayloadType payload)
	{
		this.header = header;
		this.payload = payload;
	}


	/**
	 * @return the header
	 */
	public final Map getHeader()
	{
		return header;
	}// --------------------------------------------
	/**
	 * @param header the header to set
	 */
	public final void setHeader(Map header)
	{
		this.header = header;
	}

	/**
	 * @return the pay load
	 */
	public final  PayloadType getPayload()
	{
		return payload;
	}

	/**
	 * @param payload the pay load to set
	 */
	public final void setPayload(PayloadType payload)
	{
		this.payload = payload;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString()
	{
		return "Envelope [header=" + header + ", payload=" + payload + "]";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy