public abstract class AbstractResource extends Object implements Resource
ResourceKEY_CAPABILITY, KEY_IDENTITY, KEY_REQUIREMENT| Constructor and Description |
|---|
AbstractResource() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
adapt(Class<T> type)
Adapt the this type to the given type
|
<T> T |
getAttachment(AttachmentKey<T> key)
Get the attached object for a given key
|
List<Capability> |
getCapabilities(String namespace) |
ResourceIdentity |
getIdentity() |
Capability |
getIdentityCapability() |
List<Requirement> |
getRequirements(String namespace) |
protected String |
getSimpleTypeName() |
<T> boolean |
hasAttachment(AttachmentKey<T> key)
True if there is an attached object for a given key
|
protected boolean |
isMutable() |
<T> T |
putAttachment(AttachmentKey<T> key,
T value)
Attach an arbirtary object with this element.
|
<T> T |
removeAttachment(AttachmentKey<T> key)
Remove an attached object for a given key
|
protected void |
setMutable(boolean flag) |
String |
toString() |
public <T> T adapt(Class<T> type)
Adaptablepublic Capability getIdentityCapability()
getIdentityCapability in interface Resourcepublic ResourceIdentity getIdentity()
getIdentity in interface Resourceprotected void setMutable(boolean flag)
protected boolean isMutable()
public List<Capability> getCapabilities(String namespace)
getCapabilities in interface Resourcepublic List<Requirement> getRequirements(String namespace)
getRequirements in interface Resourcepublic <T> T putAttachment(AttachmentKey<T> key, T value)
AttachableputAttachment in interface Attachablepublic <T> T getAttachment(AttachmentKey<T> key)
AttachablegetAttachment in interface Attachablepublic <T> boolean hasAttachment(AttachmentKey<T> key)
AttachablehasAttachment in interface Attachablepublic <T> T removeAttachment(AttachmentKey<T> key)
AttachableremoveAttachment in interface Attachableprotected String getSimpleTypeName()
Copyright © 2015 JBoss by Red Hat. All rights reserved.