Class WriteableTypeImpl
java.lang.Object
org.glassfish.hk2.configuration.hub.internal.WriteableTypeImpl
- All Implemented Interfaces:
Type,WriteableType
- Author:
- jwells
-
Method Summary
Modifier and TypeMethodDescriptionaddInstance(String key, Object bean) Adds the instance with the given key to the typeaddInstance(String key, Object bean, Object metadata) Adds the instance with the given key to the typegetInstance(String key) Gets the instance associated with this key, or null if there is noneReturns a read-only map of the instances that are associated with this typeGets information about this type.getName()A unique identifier for this typemodifyInstance(String key, Object newBean, PropertyChangeEvent... propChanges) Modifies the instance with the given keyremoveInstance(String key) Removes the instance with the given key from the typevoidsetMetadata(Object metadata) Sets an object containing information about this type.toString()
-
Method Details
-
getName
Description copied from interface:TypeA unique identifier for this type -
getInstances
Description copied from interface:TypeReturns a read-only map of the instances that are associated with this type- Specified by:
getInstancesin interfaceType- Returns:
- A read-only and possibly empty map of instances associated with this type
-
getInstance
Description copied from interface:TypeGets the instance associated with this key, or null if there is none- Specified by:
getInstancein interfaceType- Parameters:
key- The non-null key for the instance- Returns:
- The resulting instance or null if there is none
-
addInstance
Description copied from interface:WriteableTypeAdds the instance with the given key to the type- Specified by:
addInstancein interfaceWriteableType- Parameters:
key- A non-null name for this beanbean- The non-null bean to add- Returns:
- The instance that was created
-
addInstance
Description copied from interface:WriteableTypeAdds the instance with the given key to the type- Specified by:
addInstancein interfaceWriteableType- Parameters:
key- A non-null name for this beanbean- The non-null bean to addmetadata- Possibly null metadata to be associated with this bean- Returns:
- The instance that was created
-
removeInstance
Description copied from interface:WriteableTypeRemoves the instance with the given key from the type- Specified by:
removeInstancein interfaceWriteableType- Parameters:
key- A non-null name for this bean- Returns:
- The possibly null bean that was removed. If null then no bean was found with the given name
-
modifyInstance
public PropertyChangeEvent[] modifyInstance(String key, Object newBean, PropertyChangeEvent... propChanges) Description copied from interface:WriteableTypeModifies the instance with the given key- Specified by:
modifyInstancein interfaceWriteableType- Parameters:
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 modification- Returns:
- If changes has length greater than zero then this simply returns changes. If changes is zero length then this will return the set of changes automatically determined by the system
-
getMetadata
Description copied from interface:TypeGets information about this type. Can be used to describe the type in some useful way- Specified by:
getMetadatain interfaceType- Returns:
- The possibly null metadata associated with this type
-
setMetadata
Description copied from interface:TypeSets an object containing information about this type. Can be used to describe the type in some useful way- Specified by:
setMetadatain interfaceType- Parameters:
metadata- The possibly null metadata to be associated with this type
-
toString
-