Package org.apache.juneau.cp
Class BeanStoreEntry<T>
java.lang.Object
org.apache.juneau.cp.BeanStoreEntry<T>
- Type Parameters:
T
- The bean type.
Represents a bean in a
BeanStore
.
A bean entry consists of the following:
- A class type.
- A bean or bean supplier that returns an instance of the class type. This can be a subclass of the type.
- An optional name.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> BeanStoreEntry<T>
Static creator.get()
Returns the bean associated with this entry.getName()
Returns the name associated with this entry.getType()
Returns the type this bean is associated with.boolean
Returnstrue if this bean is exactly of the specified type.boolean
Returnstrue if this bean is exactly of the specified type and has the specified name.protected JsonMap
Returns the properties in this object as a simple map for debugging purposes.
-
Constructor Details
-
BeanStoreEntry
Constructor.- Parameters:
type
- The class type to associate with the bean.bean
- The bean supplier.name
- Optional name to associate with the bean. Can benull .
-
-
Method Details
-
create
Static creator.- Type Parameters:
T
- The class type to associate with the bean.- Parameters:
type
- The class type to associate with the bean.bean
- The bean supplier.name
- Optional name to associate with the bean. Can benull .- Returns:
- A new bean store entry.
-
matches
Returnstrue if this bean is exactly of the specified type.- Parameters:
type
- The class to check. Returnsfalse ifnull .- Returns:
true if this bean is exactly of the specified type.
-
matches
Returnstrue if this bean is exactly of the specified type and has the specified name.- Parameters:
type
- The class to check. Returnsfalse ifnull .name
- The name to check. Can benull to only match if name of entry isnull .- Returns:
true if this bean is exactly of the specified type and has the specified name.
-
get
Returns the bean associated with this entry.- Returns:
- The bean associated with this entry.
-
getType
Returns the type this bean is associated with.- Returns:
- The type this bean is associated with.
-
getName
Returns the name associated with this entry.- Returns:
- the name associated with this entry.
null if no name is associated.
-
properties
Returns the properties in this object as a simple map for debugging purposes.- Returns:
- The properties in this object as a simple map.
-