|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.degreedays.api.data.DataSpecs.CustomKeyBuilder
public static final class DataSpecs.CustomKeyBuilder
For advanced use, this provides a way to create a DataSpecs
object with custom keys. To use:
DataSpecs.CustomKeyBuilder
object.DataSpec
objects (each with
a unique string key).DataSpecs
object
containing the key-DataSpec
mappings that you've added.
Instances of this builder class are designed for single-threaded use only. It's fine to create and use instances in multiple concurrent threads, but, in the absence of external synchronization, the use of each individual builder instance should be restricted to one thread only.
Constructor Summary | |
---|---|
DataSpecs.CustomKeyBuilder()
Constructs an empty DataSpecs.CustomKeyBuilder . |
Method Summary | |
---|---|
DataSpecs.CustomKeyBuilder |
add(java.lang.String key,
DataSpec dataSpec)
Adds a unique key and the DataSpec to be associated with
it. |
DataSpecs |
build()
Creates a DataSpecs object with the configuration that
is currently held by this builder. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSpecs.CustomKeyBuilder()
DataSpecs.CustomKeyBuilder
.
Method Detail |
---|
public DataSpecs.CustomKeyBuilder add(java.lang.String key, DataSpec dataSpec)
DataSpec
to be associated with
it.
key
- a string to be used as the key for dataSpec
in the XML request and response. Cannot be null, cannot be
empty, cannot have more than 60 characters, and cannot contain
characters outside of [-_.a-zA-Z0-9]. (Note that we might
expand this set of allowed characters at some point. Please
let us know if you'd like us to.)dataSpec
- the non-null DataSpec
to be added and
associated with key
.
this
, for method chaining.
java.lang.NullPointerException
- if key
or
dataSpec
is null
.
java.lang.IllegalArgumentException
- if key
does not match
the required specification, or if a DataSpec
has
already been added with key
.public DataSpecs build()
DataSpecs
object with the configuration that
is currently held by this builder.
java.lang.IllegalStateException
- if you have not added at least one
key-DataSpec
pair, or if you have added more than
100.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |