Interface Attachments

All Known Implementing Classes:
ProtonAttachments

public interface Attachments
Attachments API used to associate specific data with AMQP Resources
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    Checks if the given key has a value mapped to it in this Attachments instance.
    <T> T
    get(String key)
    Gets the user attached value that is associated with the given key, or null if no data is mapped to the key.
    <T> T
    get(String key, Class<T> typeClass)
    Gets the user set Attachments value that is associated with the given key, or null if no data is mapped to the key.
    set(String key, T value)
    Maps a given object to the given key in this Attachments instance.
  • Method Details

    • get

      <T> T get(String key)
      Gets the user attached value that is associated with the given key, or null if no data is mapped to the key.
      Type Parameters:
      T - The type to cast the attached mapped value to if one is set.
      Parameters:
      key - The key to use to lookup the mapped data.
      Returns:
      the object associated with the given key in this Attachments instance.
    • get

      <T> T get(String key, Class<T> typeClass)
      Gets the user set Attachments value that is associated with the given key, or null if no data is mapped to the key.
      Type Parameters:
      T - The type to cast the attached mapped value to if one is set.
      Parameters:
      key - The key to use to lookup the mapped data.
      typeClass - The Class that will be used when casting the returned mapped object.
      Returns:
      the object associated with the given key in this Attachments instance.
    • set

      <T> Attachments set(String key, T value)
      Maps a given object to the given key in this Attachments instance.
      Type Parameters:
      T - The type of the value being set
      Parameters:
      key - The key to assign the value to
      value - The value to map to the given key.
      Returns:
      this Attachments instance.
    • containsKey

      boolean containsKey(String key)
      Checks if the given key has a value mapped to it in this Attachments instance.
      Parameters:
      key - The key to search for a mapping to in this Attachments instance.
      Returns:
      true if there is a value mapped to the given key in this Attachments instance.
    • clear

      Attachments clear()
      Returns:
      this Attachments instance with all mapped values and the linked resource cleared.