public class WriteableTypeImpl extends Object implements WriteableType
Modifier and Type | Method and Description |
---|---|
Instance |
addInstance(String key,
Object bean)
Adds the instance with the given key to the type
|
Instance |
addInstance(String key,
Object bean,
Object metadata)
Adds the instance with the given key to the type
|
Instance |
getInstance(String key)
Gets the instance associated with this key, or null if there is none
|
Map<String,Instance> |
getInstances()
Returns a read-only map of the instances that are associated with this type
|
Object |
getMetadata()
Gets information about this type.
|
String |
getName()
A unique identifier for this type
|
PropertyChangeEvent[] |
modifyInstance(String key,
Object newBean,
PropertyChangeEvent... propChanges)
Modifies the instance with the given key
|
Instance |
removeInstance(String key)
Removes the instance with the given key from the type
|
void |
setMetadata(Object metadata)
Sets an object containing information about this
type.
|
String |
toString() |
public String getName()
Type
public Map<String,Instance> getInstances()
Type
getInstances
in interface Type
public Instance getInstance(String key)
Type
getInstance
in interface Type
key
- The non-null key for the instancepublic Instance addInstance(String key, Object bean)
WriteableType
addInstance
in interface WriteableType
key
- A non-null name for this beanbean
- The non-null bean to addpublic Instance addInstance(String key, Object bean, Object metadata)
WriteableType
addInstance
in interface WriteableType
key
- A non-null name for this beanbean
- The non-null bean to addmetadata
- Possibly null metadata to be associated with this beanpublic Instance removeInstance(String key)
WriteableType
removeInstance
in interface WriteableType
key
- A non-null name for this beanpublic PropertyChangeEvent[] modifyInstance(String key, Object newBean, PropertyChangeEvent... propChanges)
WriteableType
modifyInstance
in interface WriteableType
key
- A non-null name or key for the bean to modifynewBean
- The new bean to use with this keypropChanges
- The full set of changes from the previous version. If this
is a zero-length array then the system will attempt to automatically determine
the changes made to this type and will generate the list of PropertyChangeEvent
to be associated with this modificationpublic Object getMetadata()
Type
getMetadata
in interface Type
public void setMetadata(Object metadata)
Type
setMetadata
in interface Type
metadata
- The possibly null metadata
to be associated with this typeCopyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.