## com.google.gwt.user.client.ui
Interface HasValue<T>

Type Parameters:
  `T` - the type of value.

All Superinterfaces:
  HasHandlers, HasValueChangeHandlers<T>

All Known Implementing Classes:
  CheckBox, DateBox, DatePicker, PasswordTextBox, RadioButton, SuggestBox, TextArea, TextBox, TextBoxBase

    public interface HasValue<T>

extends HasValueChangeHandlers<T>

An object that implements this interface should be a user input widget, where the user and programmer can both set and get the object's value. It is intended to provide a unified interface to widgets with "atomic" values, like Strings and Dates.

Method Summary
`T` | `getValue()` Gets this object's value.
`void` | `setValue(T value)` Sets this object's value without firing any events.
`void` | `setValue(T value, boolean fireEvents)` Sets this object's value.

Methods inherited from interface com.google.gwt.event.logical.shared.HasValueChangeHandlers
`addValueChangeHandler`

Methods inherited from interface com.google.gwt.event.shared.HasHandlers
`fireEvent`

Method Detail

### getValue

    T getValue()

  Gets this object's value.

  Returns:
    the object's value

### setValue

    void setValue(T value)

  Sets this object's value without firing any events. This should be identical to calling setValue(value, false).

  It is acceptable to fail assertions or throw (documented) unchecked exceptions in response to bad values.

  By convention, GWT widgets that can be cleared accept null for `value`, but it is acceptable for widgets that cannot be cleared to throw an exception for null values.

  Parameters:
    `value` - the object's new value

### setValue

    void setValue(T value,
                  boolean fireEvents)

  Sets this object's value. Fires `ValueChangeEvent` when fireEvents is true and the new value does not equal the existing value.

  It is acceptable to fail assertions or throw (documented) unchecked exceptions in response to bad values.

  Parameters:
    `value` - the object's new value
    `fireEvents` - fire events if true and value is new