java.lang.Object
com.sun.xml.ws.message.AttachmentSetImpl
- All Implemented Interfaces:
AttachmentSet
,Iterable<Attachment>
Default dumb
AttachmentSet
implementation backed by ArrayList
.
The assumption here is that the number of attachments are small enough to
justify linear search in get(String)
.
- Author:
- Kohsuke Kawaguchi
-
Constructor Summary
ConstructorDescriptionCreates an emptyAttachmentSet
.AttachmentSetImpl
(Iterable<Attachment> base) Creates anAttachmentSet
by copying contents from another. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Attachment att) Adds an attachment to this set.Gets the attachment by the content ID.boolean
isEmpty()
Returns true if there's no attachment.iterator()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
AttachmentSetImpl
public AttachmentSetImpl()Creates an emptyAttachmentSet
. -
AttachmentSetImpl
Creates anAttachmentSet
by copying contents from another.
-
-
Method Details
-
get
Description copied from interface:AttachmentSet
Gets the attachment by the content ID.- Specified by:
get
in interfaceAttachmentSet
- Parameters:
contentId
- The content ID like "[email protected]", without surrounding '<' and '>' used as the transfer syntax.- Returns:
- null if no such attachment exist.
-
isEmpty
public boolean isEmpty()Description copied from interface:AttachmentSet
Returns true if there's no attachment.- Specified by:
isEmpty
in interfaceAttachmentSet
-
add
Description copied from interface:AttachmentSet
Adds an attachment to this set.Note that it's OK for an
Attachment
to belong to more than oneAttachmentSet
(which is in fact necessary when you wrap aMessage
into another.- Specified by:
add
in interfaceAttachmentSet
- Parameters:
att
- must not be null.
-
iterator
- Specified by:
iterator
in interfaceIterable<Attachment>
-