Package org.apache.qpid.protonj2.engine
Interface Attachments
-
- All Known Implementing Classes:
ProtonAttachments
public interface AttachmentsAttachments API used to associate specific data with AMQP Resources
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Attachmentsclear()booleancontainsKey(java.lang.String key)Checks if the given key has a value mapped to it in thisAttachmentsinstance.<T> Tget(java.lang.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> Tget(java.lang.String key, java.lang.Class<T> typeClass)Gets the user setAttachmentsvalue that is associated with the given key, or null if no data is mapped to the key.<T> Attachmentsset(java.lang.String key, T value)Maps a given object to the given key in thisAttachmentsinstance.
-
-
-
Method Detail
-
get
<T> T get(java.lang.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
Attachmentsinstance.
-
get
<T> T get(java.lang.String key, java.lang.Class<T> typeClass)Gets the user setAttachmentsvalue 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
Attachmentsinstance.
-
set
<T> Attachments set(java.lang.String key, T value)
Maps a given object to the given key in thisAttachmentsinstance.- Type Parameters:
T- The type of the value being set- Parameters:
key- The key to assign the value tovalue- The value to map to the given key.- Returns:
- this
Attachmentsinstance.
-
containsKey
boolean containsKey(java.lang.String key)
Checks if the given key has a value mapped to it in thisAttachmentsinstance.- Parameters:
key- The key to search for a mapping to in thisAttachmentsinstance.- Returns:
- true if there is a value mapped to the given key in this
Attachmentsinstance.
-
clear
Attachments clear()
- Returns:
- this
Attachmentsinstance with all mapped values and the linked resource cleared.
-
-