com.cloudera.cdk.data
Class Key.Builder

java.lang.Object
  extended by com.cloudera.cdk.data.Key.Builder
Enclosing class:
Key

public static class Key.Builder
extends Object

A fluent builder to aid in the construction of Key objects.

Since:
0.9.0

Constructor Summary
Key.Builder(RandomAccessDataset dataset)
          Construct a Key.Builder for a RandomAccessDataset.
 
Method Summary
 Key.Builder add(String name, Object value)
          Add a key value for the named field.
 Key build()
          Build an instance of the configured key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Key.Builder

public Key.Builder(RandomAccessDataset dataset)
Construct a Key.Builder for a RandomAccessDataset.

Method Detail

add

public Key.Builder add(String name,
                       Object value)
Add a key value for the named field.

Returns:
An instance of the builder for method chaining.
Throws:
IllegalArgumentException - If the there is no key field named name for this builder's dataset.

build

public Key build()
Build an instance of the configured key.

Throws:
IllegalStateException - If any required key field is missing.


Copyright © 2013 Cloudera. All rights reserved.