Class ProtonAttachments
java.lang.Object
org.apache.qpid.protonj2.engine.impl.ProtonAttachments
- All Implemented Interfaces:
Attachments
Proton implementation of an Attachments object.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclear()
boolean
containsKey
(String key) Checks if the given key has a value mapped to it in thisAttachments
instance.<T> T
Gets the user attached value that is associated with the given key, or null if no data is mapped to the key.<T> T
Gets the user setAttachments
value that is associated with the given key, or null if no data is mapped to the key.Maps a given object to the given key in thisAttachments
instance.
-
Constructor Details
-
ProtonAttachments
public ProtonAttachments()
-
-
Method Details
-
get
Description copied from interface:Attachments
Gets the user attached value that is associated with the given key, or null if no data is mapped to the key.- Specified by:
get
in interfaceAttachments
- 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
Description copied from interface:Attachments
Gets the user setAttachments
value that is associated with the given key, or null if no data is mapped to the key.- Specified by:
get
in interfaceAttachments
- 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
Description copied from interface:Attachments
Maps a given object to the given key in thisAttachments
instance.- Specified by:
set
in interfaceAttachments
- Parameters:
key
- The key to assign the value tovalue
- The value to map to the given key.- Returns:
- this
Attachments
instance.
-
containsKey
Description copied from interface:Attachments
Checks if the given key has a value mapped to it in thisAttachments
instance.- Specified by:
containsKey
in interfaceAttachments
- Parameters:
key
- The key to search for a mapping to in thisAttachments
instance.- Returns:
- true if there is a value mapped to the given key in this
Attachments
instance.
-
clear
- Specified by:
clear
in interfaceAttachments
- Returns:
- this
Attachments
instance with all mapped values and the linked resource cleared.
-