Class NamedBean<T extends AnchorBean<?>>

Type Parameters:
T - item type
All Implemented Interfaces:
NameValue<T>

public class NamedBean<T extends AnchorBean<?>> extends NullParametersBean<NamedBean<T>> implements NameValue<T>
A bean with an associated textual name.
Author:
Owen Feehan
  • Constructor Details

    • NamedBean

      public NamedBean(String name, T item)
      Creates a new NamedBean instance.
      Parameters:
      name - The name associated with item.
      item - The item that is to be named, the underlying bean.
    • NamedBean

      public NamedBean()
  • Method Details

    • toString

      public String toString()
      Description copied from class: AnchorBean
      By default, we use AnchorBean.describeBean() as the string representation of the bean.
      Overrides:
      toString in class AnchorBean<NamedBean<T extends AnchorBean<?>>>
      Returns:
      the string representation
    • getValue

      public T getValue()
      Description copied from interface: NameValue
      The associated value.
      Specified by:
      getValue in interface NameValue<T extends AnchorBean<?>>
      Returns:
      the value
    • setValue

      public void setValue(T item)
      Description copied from interface: NameValue
      Assigns the associated value.
      Specified by:
      setValue in interface NameValue<T extends AnchorBean<?>>
      Parameters:
      item - value to assign
    • getName

      public String getName()
      The name associated with item.
      Specified by:
      getName in interface NameValue<T extends AnchorBean<?>>
      Returns:
      the name
    • setName

      public void setName(String name)
      The name associated with item.
      Specified by:
      setName in interface NameValue<T extends AnchorBean<?>>
      Parameters:
      name - name to assign
    • getItem

      public T getItem()
      The item that is to be named, the underlying bean.
    • setItem

      public void setItem(T item)
      The item that is to be named, the underlying bean.