Package com.sun.xml.ws.message
Class AttachmentSetImpl
- java.lang.Object
-
- com.sun.xml.ws.message.AttachmentSetImpl
-
- All Implemented Interfaces:
AttachmentSet,Iterable<Attachment>
public final class AttachmentSetImpl extends Object implements AttachmentSet
Default dumbAttachmentSetimplementation backed byArrayList.The assumption here is that the number of attachments are small enough to justify linear search in
get(String).- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description AttachmentSetImpl()Creates an emptyAttachmentSet.AttachmentSetImpl(Iterable<Attachment> base)Creates anAttachmentSetby copying contents from another.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Attachment att)Adds an attachment to this set.Attachmentget(String contentId)Gets the attachment by the content ID.booleanisEmpty()Returns true if there's no attachment.Iterator<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 Detail
-
AttachmentSetImpl
public AttachmentSetImpl()
Creates an emptyAttachmentSet.
-
AttachmentSetImpl
public AttachmentSetImpl(Iterable<Attachment> base)
Creates anAttachmentSetby copying contents from another.
-
-
Method Detail
-
get
public Attachment get(String contentId)
Description copied from interface:AttachmentSetGets the attachment by the content ID.- Specified by:
getin interfaceAttachmentSet- Parameters:
contentId- The content ID like "foo-bar-zot@abc.com", without surrounding '<' and '>' used as the transfer syntax.- Returns:
- null if no such attachment exist.
-
isEmpty
public boolean isEmpty()
Description copied from interface:AttachmentSetReturns true if there's no attachment.- Specified by:
isEmptyin interfaceAttachmentSet
-
add
public void add(Attachment att)
Description copied from interface:AttachmentSetAdds an attachment to this set.Note that it's OK for an
Attachmentto belong to more than oneAttachmentSet(which is in fact necessary when you wrap aMessageinto another.- Specified by:
addin interfaceAttachmentSet- Parameters:
att- must not be null.
-
iterator
public Iterator<Attachment> iterator()
- Specified by:
iteratorin interfaceIterable<Attachment>
-
-