org.terracotta.management.call
Class ContextualReturn<T>

java.lang.Object
  extended by org.terracotta.management.call.ContextualReturn<T>
All Implemented Interfaces:
Serializable

public final class ContextualReturn<T>
extends Object
implements Serializable

This class holds the results of the calls on each context.

If a call was not possible to make on a context, because the context was not supported or the capability not found, then the method hasValue() will return false.

You an call getValue() only if there has been a result, event if it is null.

Author:
Mathieu Carbou
See Also:
Serialized Form

Method Summary
static
<T> ContextualReturn<T>
empty(String capability, Context context)
           
 String getCapability()
           
 Context getContext()
           
 T getValue()
           
 boolean hasValue()
           
static
<T> ContextualReturn<T>
of(String capability, Context context, T result)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

hasValue

public boolean hasValue()

getValue

public T getValue()
           throws NoSuchElementException
Throws:
NoSuchElementException

getContext

public Context getContext()

of

public static <T> ContextualReturn<T> of(String capability,
                                         Context context,
                                         T result)

empty

public static <T> ContextualReturn<T> empty(String capability,
                                            Context context)

getCapability

public String getCapability()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2016. All Rights Reserved.