All Downloads are FREE. Search and download functionalities are using the official Maven repository.

brooklyn.internal.storage.Reference Maven / Gradle / Ivy

There is a newer version: 0.7.0-M1
Show newest version
package brooklyn.internal.storage;

/**
 * A reference to a value, backed by the storage-medium.
 * 
 * @see BrooklynStorage#getReference(String)
 * 
 * @author aled
 */
public interface Reference {

    // TODO We can add compareAndSet(T,T) as and when required
    
    T get();
    
    T set(T val);
    
    /**
     * @return true if the value is null; false otherwise.
     */
    boolean isNull();
    
    /**
     * Sets the value back to null. Similar to {@code set(null)}.
     */
    void clear();
    
    /**
     * @return true if the value equals the given parameter; false otherwise
     */
    boolean contains(Object other);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy