org.gitana.platform.services.node

## Class NodeBuilder

- java.lang.Object
- - org.gitana.platform.services.node.NodeBuilder

    public class NodeBuilder
    extends Object

Builder utility that helps in creating nodes.

Author:
  uzi

### Field Summary

Fields
`protected String` `_currentKey`
`protected com.fasterxml.jackson.databind.node.ObjectNode` `_query`

### Constructor Summary

Constructors
`protected` `NodeBuilder()` Creates a builder

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`NodeBuilder` `and(String key)` Used to create a compund expression around an AND clause.
`com.fasterxml.jackson.databind.node.ObjectNode` `get()` Retrieves the assembled object node.
`NodeBuilder` `hasFeature(String featureId)` Adds a feature to the node
`NodeBuilder` `hasFeature(String featureId, com.fasterxml.jackson.databind.node.ObjectNode config)` Adds a feature to the node
`NodeBuilder` `hasQName(QName qname)` Sets the qname
`NodeBuilder` `hasQName(String qname)` Sets the qname
`NodeBuilder` `hasType(String type)` Sets the type
`NodeBuilder` `is(Object... objects)` Is (equality)
`NodeBuilder` `is(Object object)` Is (equality)
`NodeBuilder` `isContainer()` Establishes the node as a container.
`NodeBuilder` `put(String key)` Adds a new key to the object if not present yet.
`static NodeBuilder` `start(String key)` Creates a new builder for an object.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### _query

    protected com.fasterxml.jackson.databind.node.ObjectNode _query

#### _currentKey

    protected String _currentKey

### Constructor Detail

#### NodeBuilder

    protected NodeBuilder()

Creates a builder

### Method Detail

#### start

    public static NodeBuilder start(String key)

Creates a new builder for an object.

Parameters:
  `key` - key
Returns:
  builder

#### put

    public NodeBuilder put(String key)

Adds a new key to the object if not present yet. Sets this key as the current key.

Parameters:
  `key` - key
Returns:
  builder

#### and

    public NodeBuilder and(String key)

Used to create a compund expression around an AND clause. Example: JSONBuilder.start("key1").is("value1").and("key2").is("value2") Yields: {"key1":"value1", "key2":"value2"}

Parameters:
  `key` -
Returns:
  builder

#### is

    public NodeBuilder is(Object object)

Is (equality)

Parameters:
  `object` - value
Returns:
  builder

#### is

    public NodeBuilder is(Object... objects)

Is (equality)

Parameters:
  `objects` -
Returns:
  builder

#### get

    public com.fasterxml.jackson.databind.node.ObjectNode get()

Retrieves the assembled object node.

Returns:
  object node

#### hasFeature

    public NodeBuilder hasFeature(String featureId)

Adds a feature to the node

Parameters:
  `featureId` -
Returns:
  query builder

#### hasFeature

    public NodeBuilder hasFeature(String featureId,
                                  com.fasterxml.jackson.databind.node.ObjectNode config)

Adds a feature to the node

Parameters:
  `featureId` -
  `config` -
Returns:

#### isContainer

    public NodeBuilder isContainer()

Establishes the node as a container.

Returns:
  builder

#### hasType

    public NodeBuilder hasType(String type)

Sets the type

Parameters:
  `type` -
Returns:

#### hasQName

    public NodeBuilder hasQName(String qname)

Sets the qname

Parameters:
  `qname` -
Returns:

#### hasQName

    public NodeBuilder hasQName(QName qname)

Sets the qname

Parameters:
  `qname` -
Returns: