public class AttachmentTools extends Object
Attachments can be made for an object or a thread context.
| Constructor and Description |
|---|
AttachmentTools() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addAttachment(Attachment attachment)
Add a
Attachment to the thread context. |
static void |
addAttachment(String key,
Object value)
Add a
Attachment to the thread context. |
static void |
addAttachments(Attachment[] pAttachments)
Add an array of
Attachment instances to the thread context. |
static void |
addAttachments(List<Attachment> pAttachments)
Add a list of
Attachment instances to the thread context. |
static void |
attach() |
static void |
clearAttachments()
Clear all attachments for the thread context.
|
static void |
detach() |
static Attachment |
getAttachment(String key)
Get the first
Attachment matching "key" in the thread context. |
static Attachment[] |
getAttachments()
Get all
Attachment instances for the thread context. |
static Attachment[] |
getAttachments(String key)
Get all attachments matching "key" in the thread context.
|
static boolean |
hasAttachment(String key)
true if the thread context has an attachment for "key" |
static boolean |
removeAttached(Object attached)
Remove attachment with attached object in the thread context.
|
static boolean |
removeAttachment(Attachment pAttachment)
Remove attachment in the thread context.
|
static void |
removeAttachments(String key)
Remove all attachments for key in the thread context.
|
public static void addAttachment(Attachment attachment)
Attachment to the thread context.attachment - The new attachmentpublic static void addAttachment(String key, Object value)
Attachment to the thread context.key - The keyvalue - The attached objectpublic static void addAttachments(Attachment[] pAttachments)
Attachment instances to the thread context.pAttachments - public static void addAttachments(List<Attachment> pAttachments)
Attachment instances to the thread context.pAttachments - public static void attach()
public static void clearAttachments()
public static void detach()
public static Attachment getAttachment(String key)
Attachment matching "key" in the thread context.key - The key value that is searchedAttachment or nullpublic static Attachment[] getAttachments()
Attachment instances for the thread context.public static Attachment[] getAttachments(String key)
key - The key value that is searchedpublic static boolean hasAttachment(String key)
true if the thread context has an attachment for "key"key - The key value that is searchedtrue if object has an attachment for "key"public static boolean removeAttached(Object attached)
attached - public static boolean removeAttachment(Attachment pAttachment)
pAttachment - public static void removeAttachments(String key)
key - The key value for the attachments to be removedCopyright © 2013 intarsys consulting GmbH. All Rights Reserved.