org.jboss.deployers.spi.attachments.helpers
Class AbstractMutableAttachments

java.lang.Object
  extended by org.jboss.deployers.spi.attachments.helpers.AbstractAttachments
      extended by org.jboss.deployers.spi.attachments.helpers.AbstractMutableAttachments
All Implemented Interfaces:
Externalizable, Serializable, Attachments, MutableAttachments
Direct Known Subclasses:
AbstractDeploymentUnit, AttachmentsImpl

public abstract class AbstractMutableAttachments
extends AbstractAttachments
implements MutableAttachments

AbstractMutableAttachments.

Version:
$Revision: 1.1 $
Author:
Adrian Brock
See Also:
Serialized Form

Constructor Summary
AbstractMutableAttachments()
           
 
Method Summary
<T> T
addAttachment(Class<T> type, T attachment)
          Add attachment
<T> T
addAttachment(String name, T attachment, Class<T> expectedType)
          Add attachment
<T> T
removeAttachment(Class<T> type)
          Remove attachment
<T> T
removeAttachment(String name, Class<T> expectedType)
          Remove attachment
 void setAttachments(Map<String,Object> map)
          Set the attachments
 
Methods inherited from class org.jboss.deployers.spi.attachments.helpers.AbstractAttachments
getAttachment, getAttachment, isAttachmentPresent, isAttachmentPresent, readExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.deployers.spi.attachments.MutableAttachments
addAttachment, clear, clearChangeCount, getChangeCount, removeAttachment
 
Methods inherited from interface org.jboss.deployers.spi.attachments.Attachments
getAttachment, getAttachment, getAttachment, getAttachments, hasAttachments, isAttachmentPresent, isAttachmentPresent, isAttachmentPresent
 

Constructor Detail

AbstractMutableAttachments

public AbstractMutableAttachments()
Method Detail

addAttachment

public <T> T addAttachment(String name,
                           T attachment,
                           Class<T> expectedType)
Description copied from interface: MutableAttachments
Add attachment

Specified by:
addAttachment in interface MutableAttachments
Type Parameters:
T - the expected type
Parameters:
name - the name of the attachment
attachment - the attachment
expectedType - the expected type
Returns:
any previous attachment

setAttachments

public void setAttachments(Map<String,Object> map)
Description copied from interface: MutableAttachments
Set the attachments

Specified by:
setAttachments in interface MutableAttachments
Parameters:
map - the new attachments a map of names to attachments

addAttachment

public <T> T addAttachment(Class<T> type,
                           T attachment)
Description copied from interface: MutableAttachments
Add attachment

Specified by:
addAttachment in interface MutableAttachments
Type Parameters:
T - the expected type
Parameters:
type - the type
attachment - the attachment
Returns:
any previous attachment

removeAttachment

public <T> T removeAttachment(String name,
                              Class<T> expectedType)
Description copied from interface: MutableAttachments
Remove attachment

Specified by:
removeAttachment in interface MutableAttachments
Type Parameters:
T - the expected type
Parameters:
name - the name of the attachment
expectedType - the expected type
Returns:
the attachment or null if not present

removeAttachment

public <T> T removeAttachment(Class<T> type)
Description copied from interface: MutableAttachments
Remove attachment

Specified by:
removeAttachment in interface MutableAttachments
Type Parameters:
T - the expected type
Parameters:
type - the type
Returns:
the attachment or null if not present


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.