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

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

public final class ContextualReturn<T extends Serializable>
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 extends Serializable>
ContextualReturn<T>
empty(String capability, Context context, String methodName)
           
 boolean equals(Object o)
           
 String getCapability()
           
 Context getContext()
           
 String getMethodName()
           
 T getValue()
           
 int hashCode()
           
 boolean hasValue()
           
static
<T extends Serializable>
ContextualReturn<T>
of(String capability, Context context, String methodName, T result)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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 extends Serializable> ContextualReturn<T> of(String capability,
                                                              Context context,
                                                              String methodName,
                                                              T result)

empty

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

getCapability

public String getCapability()

getMethodName

public String getMethodName()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2016. All Rights Reserved.