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

java.lang.Object
  extended by com.google.gwt.valuestore.shared.impl.RecordImpl
All Implemented Interfaces:
Record

public class RecordImpl
extends java.lang.Object
implements Record

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

Base class for implementations of Record. It wraps a RecordJsoImpl that does all the actual work. This class has little reason to exist except to allow client code to make instanceof checks, and to work around issue 4859 (JSOs cannot have abstract superclasses). If the issue is fixed it might be worth abandoning the instanceof capability, needs thinking.


Field Summary
 
Fields inherited from interface com.google.gwt.valuestore.shared.Record
id, version
 
Method Summary
 RecordJsoImpl asJso()
           
<V> V
get(Property<V> property)
          Get this record's value for the given property.
 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()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

asJso

public RecordJsoImpl asJso()

get

public <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

getId

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

getRef

public <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 RecordSchema<?> getSchema()

getVersion

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