ref_send API 1.16
defensive programming in Java

org.ref_send.promise
Class Fulfilled<T>

java.lang.Object
  extended by org.ref_send.promise.Fulfilled<T>
Type Parameters:
T - referent type
All Implemented Interfaces:
java.io.Serializable, Selfless, Promise<T>, Volatile<T>
Direct Known Subclasses:
Inline

public class Fulfilled<T>
extends java.lang.Object
implements Promise<T>, Selfless, java.io.Serializable

A promise that alleges to be fulfilled.

See Also:
Serialized Form

Method Summary
 T cast()
          Gets the fulfilled value.
static
<T> Fulfilled<T>
detach(T value)
          Marks a point where deserialization of an object graph may be deferred.
 boolean equals(java.lang.Object x)
          Is the given object the same?
 int hashCode()
          Calculates the hash code.
static
<T> Promise<T>
ref(T value)
          Adapts an immediate reference to the Promise interface.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ref

public static <T> Promise<T> ref(T value)
Adapts an immediate reference to the Promise interface.

Type Parameters:
T - referent type
Parameters:
value - immediate referent
Returns:
promise that refers to the value

detach

public static <T> Fulfilled<T> detach(T value)
Marks a point where deserialization of an object graph may be deferred.

If a referrer holds the promise returned by this method, instead of a direct reference to the referent, the persistence engine may defer deserialization of the referent until it is accessed.

Type Parameters:
T - referent type
Parameters:
value - referent
Returns:
promise that refers to the value

equals

public boolean equals(java.lang.Object x)
Is the given object the same?

Overrides:
equals in class java.lang.Object
Parameters:
x - compared to object
Returns:
true if the same, else false

hashCode

public int hashCode()
Calculates the hash code.

Specified by:
hashCode in interface Selfless
Overrides:
hashCode in class java.lang.Object

cast

public T cast()
Gets the fulfilled value.

Specified by:
cast in interface Volatile<T>

ref_send API 1.16
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2007 Waterken Inc. under the terms of the MIT X license.