com.stackmob.sdkapi
Class SMValue<T>

java.lang.Object
  extended by com.stackmob.sdkapi.SMValue<T>
Type Parameters:
T - The type of this value, see subclasses for explicit types
Direct Known Subclasses:
SMCollection, SMObject, SMPrimitive, SMString

public abstract class SMValue<T>
extends Object

An object representing a value stored in the StackMob datastore


Field Summary
protected  T value
           
 
Constructor Summary
SMValue(T value)
          Create a new SMValue
 
Method Summary
<U extends SMValue>
U
asA(Class<U> cls)
           
 boolean equals(Object o)
           
 T getValue()
          Get the stored value
 int hashCode()
           
<U extends SMValue>
boolean
isA(Class<U> cls)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected final T value
Constructor Detail

SMValue

public SMValue(T value)
Create a new SMValue

Parameters:
value - the value of this SMValue
Method Detail

getValue

public T getValue()
Get the stored value

Returns:
the value of this SMValue

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

isA

public <U extends SMValue> boolean isA(Class<U> cls)

asA

public <U extends SMValue> U asA(Class<U> cls)
                      throws CannotCastSMValueException
Throws:
CannotCastSMValueException


Copyright © 2012 StackMob. All Rights Reserved.