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 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 booleanfailed()Returnstrueif thisValueResultrepresents a failure andfalseotherwise.Binding.SyncFailuregetFailure()Returns the failure if thisValueResultrepresents a failure and throwsUnsupportedOperationExceptionotherwise.VgetValue()Returns the resulting value if thisValueResultdoes not represent a failure and throwsUnsupportedOperationExceptionotherwise.StringtoString()Returns a string representation of theValueResult.booleanwarningOccurred()
-
-
-
Method Detail
-
failed
public boolean failed()
Returnstrueif thisValueResultrepresents a failure andfalseotherwise.- Returns:
trueif thisValueResultrepresents a failure andfalseotherwise- See Also:
getFailure()
-
warningOccurred
public boolean warningOccurred()
-
getValue
public V getValue()
Returns the resulting value if thisValueResultdoes not represent a failure and throwsUnsupportedOperationExceptionotherwise.- Returns:
- the resulting value
- Throws:
UnsupportedOperationException- if thisValueResultrepresents a failure- See Also:
failed()
-
getFailure
public Binding.SyncFailure getFailure()
Returns the failure if thisValueResultrepresents a failure and throwsUnsupportedOperationExceptionotherwise.- Returns:
- the failure
- Throws:
UnsupportedOperationException- if thisValueResultdoes not represent a failure- See Also:
failed()
-
toString
public 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.
-
-