Package org.jdesktop.beansbinding
Class Binding.ValueResult<V>
- java.lang.Object
-
- org.jdesktop.beansbinding.Binding.ValueResult<V>
-
public static final class Binding.ValueResult<V> extends java.lang.Object
Encapsulates the result from callingBinding.getSourceValueForTarget()
orBinding.getTargetValueForSource()
, which can either be a successful value or a failure.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
failed()
Returnstrue
if thisValueResult
represents a failure andfalse
otherwise.Binding.SyncFailure
getFailure()
Returns the failure if thisValueResult
represents a failure and throwsUnsupportedOperationException
otherwise.V
getValue()
Returns the resulting value if thisValueResult
does not represent a failure and throwsUnsupportedOperationException
otherwise.java.lang.String
toString()
Returns a string representation of theValueResult
.
-
-
-
Method Detail
-
failed
public boolean failed()
Returnstrue
if thisValueResult
represents a failure andfalse
otherwise.- Returns:
true
if thisValueResult
represents a failure andfalse
otherwise- See Also:
getFailure()
-
getValue
public V getValue()
Returns the resulting value if thisValueResult
does not represent a failure and throwsUnsupportedOperationException
otherwise.- Returns:
- the resulting value
- Throws:
java.lang.UnsupportedOperationException
- if thisValueResult
represents a failure- See Also:
failed()
-
getFailure
public Binding.SyncFailure getFailure()
Returns the failure if thisValueResult
represents a failure and throwsUnsupportedOperationException
otherwise.- Returns:
- the failure
- Throws:
java.lang.UnsupportedOperationException
- if thisValueResult
does not represent a failure- See Also:
failed()
-
toString
public java.lang.String toString()
Returns a string representation of theValueResult
. 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 benull
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string representation of this
ValueResult
-
-