Class DefaultAttachment

java.lang.Object
org.apache.camel.attachment.DefaultAttachment
All Implemented Interfaces:
Attachment

public class DefaultAttachment extends Object implements Attachment
  • Constructor Details

    • DefaultAttachment

      public DefaultAttachment(jakarta.activation.DataHandler dh)
    • DefaultAttachment

      public DefaultAttachment(jakarta.activation.DataSource ds)
  • Method Details

    • getDataHandler

      public jakarta.activation.DataHandler getDataHandler()
      Description copied from interface: Attachment
      Return a DataHandler for the content within this attachment.
      Specified by:
      getDataHandler in interface Attachment
      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 interface Attachment
      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 interface Attachment
      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 interface Attachment
      Parameters:
      headerName - the name of this header
      headerValue - 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 interface Attachment
      Parameters:
      headerName - the name of this header
      headerValue - 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 interface Attachment
      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 interface Attachment
      Returns:
      a collection of all header names
    • clearHeaders

      public void clearHeaders()
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object