com.google.gwt.valuestore.shared.impl
Class RecordJsoImpl

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.valuestore.shared.impl.RecordJsoImpl
All Implemented Interfaces:
Record

public class RecordJsoImpl
extends JavaScriptObject
implements Record

Experimental API: This class is still under rapid development, and is very likely to be deleted. Use it at your own risk.

JSO implementation of Record, used to back subclasses of RecordImpl.


Field Summary
 
Fields inherited from interface com.google.gwt.valuestore.shared.Record
id, version
 
Method Summary
static JsArray<RecordJsoImpl> arrayFromJson(java.lang.String json)
           
static RecordJsoImpl create(java.lang.String id, java.lang.Integer version, RecordSchema<?> schema)
           
 void delete(java.lang.String name)
           
static RecordJsoImpl emptyCopy(RecordImpl from)
           
static RecordJsoImpl fromJson(java.lang.String json)
           
<V> V
get(Property<V> property)
          Get this record's value for the given property.
<T> T
get(java.lang.String propertyName)
           
 java.lang.String getId()
           
<V> PropertyReference<V>
getRef(Property<V> property)
          Get a "pointer" to value of this property in the receiver, useful for making rpc requests against values that have not yet reached the client.
 RecordSchema<?> getSchema()
           
 java.lang.Integer getVersion()
           
 boolean isDefined(java.lang.String name)
           
 boolean isEmpty()
           
 boolean merge(RecordJsoImpl from)
           
<V> void
set(Property<V> property, V value)
           
 void setSchema(RecordSchema<?> schema)
           
 java.lang.String toJson()
          Return JSON representation using org.json library.
 java.lang.String toJsonIdVersion()
          Return JSON representation of just id and version fields, using org.json library.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

arrayFromJson

public static JsArray<RecordJsoImpl> arrayFromJson(java.lang.String json)

create

public static RecordJsoImpl create(java.lang.String id,
                                   java.lang.Integer version,
                                   RecordSchema<?> schema)

emptyCopy

public static RecordJsoImpl emptyCopy(RecordImpl from)

fromJson

public static RecordJsoImpl fromJson(java.lang.String json)

delete

public final void delete(java.lang.String name)

get

public final <V> V get(Property<V> property)
Description copied from interface: Record
Get this record's value for the given property. Behavior is undefined if the record has no such property, or if the property has never been set. It is unusual to call this method directly. Rather it is expected to be called by bean-style getter methods provided by implementing classes.

Specified by:
get in interface Record
Type Parameters:
V - the type of the property's value
Parameters:
property - the property to fetch
Returns:
the value

get

public final <T> T get(java.lang.String propertyName)

getId

public final java.lang.String getId()
Specified by:
getId in interface Record
Returns:
the id of this Record

getRef

public final <V> PropertyReference<V> getRef(Property<V> property)
Description copied from interface: Record
Get a "pointer" to value of this property in the receiver, useful for making rpc requests against values that have not yet reached the client.

Specified by:
getRef in interface Record
Type Parameters:
V - the type of the property value
Parameters:
property - the property referred to
Returns:
a reference to the receiver's value of this property

getSchema

public final RecordSchema<?> getSchema()

getVersion

public final java.lang.Integer getVersion()
Specified by:
getVersion in interface Record
Returns:
the version of this Record

isDefined

public final boolean isDefined(java.lang.String name)
Parameters:
name -

isEmpty

public final boolean isEmpty()

merge

public final boolean merge(RecordJsoImpl from)

set

public final <V> void set(Property<V> property,
                          V value)

setSchema

public final void setSchema(RecordSchema<?> schema)

toJson

public final java.lang.String toJson()
Return JSON representation using org.json library.

Returns:
returned string.

toJsonIdVersion

public final java.lang.String toJsonIdVersion()
Return JSON representation of just id and version fields, using org.json library.

Returns:
returned string.