org.jdesktop.beansbinding
Class Binding.ValueResult<V>

java.lang.Object
  extended by org.jdesktop.beansbinding.Binding.ValueResult<V>
Enclosing class:
Binding<SS,SV,TS,TV>

public static final class Binding.ValueResult<V>
extends java.lang.Object

Encapsulates the result from calling Binding.getSourceValueForTarget() or Binding.getTargetValueForSource(), which can either be a successful value or a failure.


Method Summary
 boolean failed()
          Returns true if this ValueResult represents a failure and false otherwise.
 Binding.SyncFailure getFailure()
          Returns the failure if this ValueResult represents a failure and throws UnsupportedOperationException otherwise.
 V getValue()
          Returns the resulting value if this ValueResult does not represent a failure and throws UnsupportedOperationException otherwise.
 java.lang.String toString()
          Returns a string representation of the ValueResult.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

failed

public boolean failed()
Returns true if this ValueResult represents a failure and false otherwise.

Returns:
true if this ValueResult represents a failure and false otherwise
See Also:
getFailure()

getValue

public V getValue()
Returns the resulting value if this ValueResult does not represent a failure and throws UnsupportedOperationException otherwise.

Returns:
the resulting value
Throws:
java.lang.UnsupportedOperationException - if this ValueResult represents a failure
See Also:
failed()

getFailure

public Binding.SyncFailure getFailure()
Returns the failure if this ValueResult represents a failure and throws UnsupportedOperationException otherwise.

Returns:
the failure
Throws:
java.lang.UnsupportedOperationException - if this ValueResult does not represent a failure
See Also:
failed()

toString

public java.lang.String toString()
Returns a string representation of the ValueResult. This method is intended to be used for debugging purposes only, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this ValueResult