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 void
addHeader(String headerName, String headerValue)
Add this value to the existing values for this headerName.void
clearHeaders()
boolean
equals(Object other)
DataHandler
getDataHandler()
Return a DataHandler for the content within this attachment.String
getHeader(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.int
hashCode()
void
removeHeader(String headerName)
Remove all headers with this name.void
setHeader(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:Attachment
Return a DataHandler for the content within this attachment.- Specified by:
getDataHandler
in interfaceAttachment
- Returns:
- DataHandler for the content
-
getHeader
public String getHeader(String name)
Description copied from interface:Attachment
Get all the headers for this header name. Returns null if no headers for this header name are available.- Specified by:
getHeader
in 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:Attachment
Get all the headers for this header name. Returns null if no headers for this header name are available.- Specified by:
getHeaderAsList
in 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:Attachment
Add this value to the existing values for this headerName.- Specified by:
addHeader
in 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:Attachment
Set the value for this headerName. Replaces all existing header values with this new value.- Specified by:
setHeader
in interfaceAttachment
- Parameters:
headerName
- the name of this headerheaderValue
- the value for this header
-
removeHeader
public void removeHeader(String headerName)
Description copied from interface:Attachment
Remove all headers with this name.- Specified by:
removeHeader
in interfaceAttachment
- Parameters:
headerName
- the name of this header
-
getHeaderNames
public Collection<String> getHeaderNames()
Description copied from interface:Attachment
Get all header names for this attachment.- Specified by:
getHeaderNames
in interfaceAttachment
- Returns:
- a collection of all header names
-
clearHeaders
public void clearHeaders()
-
-