- java.lang.Object
-
- jmri.NamedBeanHandle<T>
-
- Type Parameters:
T
- the class of the NamedBean
public class NamedBeanHandle<T extends NamedBean> extends java.lang.Object
Utility class for managing access to a NamedBean.This associates a particular name (either the user name or system name, typically) with a specific NamedBean. Later, when the user wants to do a rename operation, this is used to decide whether this particular reference should be renamed. Note, however, that these should only be created and access via the
NamedBeanHandleManager
instance.- See Also:
NamedBeanHandleManager
,NamedBean
-
-
Constructor Summary
Constructors Constructor Description NamedBeanHandle(java.lang.String name, T bean)
Create a handle to a particular bean accessed by a specific name.
-
-
-
Constructor Detail
-
NamedBeanHandle
public NamedBeanHandle(@Nonnull java.lang.String name, @Nonnull T bean)
Create a handle to a particular bean accessed by a specific name.Usually, defer to
NamedBeanHandleManager
to create these- Parameters:
name
- the name for the handlebean
- the bean to handle
-
-
Method Detail
-
getBean
@CheckReturnValue public T getBean()
-
setName
public void setName(java.lang.String name)
-
toString
@CheckReturnValue public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
@CheckReturnValue public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
@CheckReturnValue public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-