Package org.apache.camel.attachment
Class DefaultAttachment
- java.lang.Object
-
- org.apache.camel.attachment.DefaultAttachment
-
- All Implemented Interfaces:
Attachment
public class DefaultAttachment extends Object implements Attachment
-
-
Constructor Summary
Constructors Constructor Description DefaultAttachment(DataHandler dh)DefaultAttachment(DataSource ds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(String headerName, String headerValue)Add this value to the existing values for this headerName.voidclearHeaders()booleanequals(Object other)DataHandlergetDataHandler()Return a DataHandler for the content within this attachment.StringgetHeader(String name)Get all the headers for this header name.List<String>getHeaderAsList(String name)Get all the headers for this header name.Collection<String>getHeaderNames()Get all header names for this attachment.inthashCode()voidremoveHeader(String headerName)Remove all headers with this name.voidsetHeader(String headerName, String headerValue)Set the value for this headerName.
-
-
-
Constructor Detail
-
DefaultAttachment
public DefaultAttachment(DataHandler dh)
-
DefaultAttachment
public DefaultAttachment(DataSource ds)
-
-
Method Detail
-
getDataHandler
public DataHandler getDataHandler()
Description copied from interface:AttachmentReturn a DataHandler for the content within this attachment.- Specified by:
getDataHandlerin interfaceAttachment- Returns:
- DataHandler for the content
-
getHeader
public String getHeader(String name)
Description copied from interface:AttachmentGet all the headers for this header name. Returns null if no headers for this header name are available.- Specified by:
getHeaderin interfaceAttachment- Parameters:
name- he name of this header- Returns:
- a comma separated list of all header values
-
getHeaderAsList
public List<String> getHeaderAsList(String name)
Description copied from interface:AttachmentGet all the headers for this header name. Returns null if no headers for this header name are available.- Specified by:
getHeaderAsListin interfaceAttachment- Parameters:
name- The name of this header- Returns:
- a list of all header values
-
addHeader
public void addHeader(String headerName, String headerValue)
Description copied from interface:AttachmentAdd this value to the existing values for this headerName.- Specified by:
addHeaderin interfaceAttachment- Parameters:
headerName- the name of this headerheaderValue- the value for this header
-
setHeader
public void setHeader(String headerName, String headerValue)
Description copied from interface:AttachmentSet the value for this headerName. Replaces all existing header values with this new value.- Specified by:
setHeaderin interfaceAttachment- Parameters:
headerName- the name of this headerheaderValue- the value for this header
-
removeHeader
public void removeHeader(String headerName)
Description copied from interface:AttachmentRemove all headers with this name.- Specified by:
removeHeaderin interfaceAttachment- Parameters:
headerName- the name of this header
-
getHeaderNames
public Collection<String> getHeaderNames()
Description copied from interface:AttachmentGet all header names for this attachment.- Specified by:
getHeaderNamesin interfaceAttachment- Returns:
- a collection of all header names
-
clearHeaders
public void clearHeaders()
-
-