com.googlecode.objectify.impl.load
Class Setter

java.lang.Object
  extended by com.googlecode.objectify.impl.load.Setter
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
CollisionDetectingSetter, RootSetter

public abstract class Setter
extends java.lang.Object
implements java.lang.Cloneable

A setter knows how to set a value in an object graph. It may be composed of a variety of internal setters that know how to set a value deep in an object graph. The value being set is a leaf value from the datastore; that is, something that it persists directly (basic type or collection of basic types).

For example, imagine a Setter for a Person entity with property "name.firstName".

Setters are a linear chain like a linked list. They are also immutable. You extend the chain by calling extend(), passing in the new tail; this produces an entirely new list.


Constructor Summary
Setter()
           
 
Method Summary
 Setter clone()
          Create a copy of this Setter and all child setters in the chain.
 Setter extend(Setter tail)
          Extends the whole chain, adding a setter to the tail.
 Setter getNext()
           
abstract  void set(java.lang.Object toPojo, java.lang.Object value, LoadContext context)
          Called by the Transmog to set a value on an object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Setter

public Setter()
Method Detail

set

public abstract void set(java.lang.Object toPojo,
                         java.lang.Object value,
                         LoadContext context)
Called by the Transmog to set a value on an object. Might actually delegate to some composite setter to actually set a value deep in the structure.


getNext

public Setter getNext()
Returns:
the next setter in the chain, or null if there is none

extend

public Setter extend(Setter tail)
Extends the whole chain, adding a setter to the tail. Since the setters are immutable, this returns an entirely new list with the tail at the end.


clone

public Setter clone()
Create a copy of this Setter and all child setters in the chain.

Overrides:
clone in class java.lang.Object


Copyright © 2011 Jeff Schnitzer and a gang of pirates. All Rights Reserved. Build version: 3.1