public class InputDataSenderBuilder extends Object implements Serializable, IDataSenderBuilder
Constructor and Description |
---|
InputDataSenderBuilder()
Raw constructor.
|
InputDataSenderBuilder(String mutationName)
Base constructor, defining the mutation name
|
Modifier and Type | Method and Description |
---|---|
InputDataSenderBuilder |
addChild(IDataSenderBuilder child)
Add a request for a specific child from the object
|
InputDataSenderBuilder |
addField(String key,
Object value)
Adds a field and its value to set via the mutation
|
InputDataSenderBuilder |
addField(WWFieldsAttributesInterface enumName,
Object value)
Adds a field and its value to set via the mutation
|
String |
build()
Builds the JSON stream to send.
|
String |
build(boolean pretty)
Builds the JSON stream to send, optionally adding pretty styling
|
List<IDataSenderBuilder> |
getChildren() |
Map<String,Object> |
getFieldsMap() |
String |
getMutationName() |
InputDataSenderBuilder |
removeChild(IDataSenderBuilder child)
Removes a request for a specific child from the object
|
InputDataSenderBuilder |
removeField(String key)
Removes a field to set via the mutation
|
InputDataSenderBuilder |
removeField(WWFieldsAttributesInterface enumName)
Removes a field to set via the mutation
|
InputDataSenderBuilder |
setChildren(List<IDataSenderBuilder> children) |
void |
setFieldsMap(Map<String,Object> fieldsMap) |
void |
setMutationName(String mutationName) |
public InputDataSenderBuilder()
public InputDataSenderBuilder(String mutationName)
mutationName
- String name of the mutation, e.g. createSpacepublic String build()
IDataSenderBuilder
IDataSenderBuilder.build(boolean)
, passing falsebuild
in interface IDataSenderBuilder
public String build(boolean pretty)
IDataSenderBuilder
build
in interface IDataSenderBuilder
pretty
- boolean whether or not to output in a more readable formatpublic String getMutationName()
public void setMutationName(String mutationName)
mutationName
- String, name of the mutation objectpublic Map<String,Object> getFieldsMap()
public void setFieldsMap(Map<String,Object> fieldsMap)
fieldsMap
- Map of fields to set via the mutationpublic InputDataSenderBuilder addField(String key, Object value)
key
- String field namevalue
- Object value to setpublic InputDataSenderBuilder addField(WWFieldsAttributesInterface enumName, Object value) throws WWException
enumName
- WWFieldsAttributesInterface enum, whose label property is the name of the field to set via the mutationvalue
- Object value to setWWException
- containing an error message, if the value is a different data type to what the enum expectspublic InputDataSenderBuilder removeField(String key)
key
- String field namepublic InputDataSenderBuilder removeField(WWFieldsAttributesInterface enumName)
enumName
- WWFieldsAttributesInterface enum, whose label property is the name of the field to set via the mutationpublic List<IDataSenderBuilder> getChildren()
IDataSenderBuilder
children to request from the objectpublic InputDataSenderBuilder setChildren(List<IDataSenderBuilder> children)
children
- List of IDataSenderBuilder
children to request from the objectpublic InputDataSenderBuilder addChild(IDataSenderBuilder child)
child
- DataSenderBuilder, child to addpublic InputDataSenderBuilder removeChild(IDataSenderBuilder child)
child
- DataSenderBuilder, child to removeCopyright © 2018 OpenNTF. All rights reserved.