@InterfaceAudience.Private @InterfaceStability.Unstable public class ActionAttributesBuilder extends Object implements Builder<ActionAttributes>
ActionAttributes.
The properties of the builder can only be set once, an attempt to set them a second time will trigger
an IllegalStateException. The properties that are lists are an exception to this rule, of course multiple
elements can be added / removed.
Builder instances can be used to build several elements, although properties already set cannot be changed after
a call to build() either.| Modifier and Type | Method and Description |
|---|---|
ActionAttributes |
build()
Creates a new
ActionAttributes object with the properties stores in this builder. |
void |
clearJobXmls()
Removes all job XMLs that are registered with this builder.
|
static ActionAttributesBuilder |
create()
Creates and returns an empty builder.
|
static ActionAttributesBuilder |
createFromAction(Node action) |
static ActionAttributesBuilder |
createFromExisting(ActionAttributes attributes)
Create and return a new
ActionAttributesBuilder that is based on an already built
ActionAttributes object. |
void |
withConfigProperty(String key,
String value)
Registers a configuration property (a key-value pair) with this builder.
|
void |
withJobXml(String jobXml)
Registers a job XML with this builder.
|
void |
withLauncher(Launcher launcher) |
void |
withNameNode(String nameNode)
Registers a name node.
|
void |
withoutJobXml(String jobXml)
Removes a job XML if it is registered with this builder, otherwise does nothing.
|
void |
withResourceManager(String resourceManager) |
public static ActionAttributesBuilder create()
public static ActionAttributesBuilder createFromExisting(ActionAttributes attributes)
ActionAttributesBuilder that is based on an already built
ActionAttributes object. The properties of the builder will initially be the same as those of the
provided ActionAttributes object, but it is possible to modify them once.attributes - The ActionAttributes object on which this ActionAttributesBuilder will be based.ActionAttributesBuilder that is based on a previously built
ActionAttributes object.public static ActionAttributesBuilder createFromAction(Node action)
public void withResourceManager(String resourceManager)
public void withNameNode(String nameNode)
nameNode - The string representing the name node.IllegalStateException - if a name node has already been set on this builder.public void withJobXml(String jobXml)
jobXml - The job XML to register.public void withoutJobXml(String jobXml)
jobXml - The job XML to remove.public void clearJobXmls()
public void withConfigProperty(String key, String value)
key - The name of the property to set.value - The value of the property to set.IllegalStateException - if the provided key has already been set on this builder.public void withLauncher(Launcher launcher)
public ActionAttributes build()
ActionAttributes object with the properties stores in this builder.
The new ActionAttributes object is independent of this builder and the builder can be used to build
new instances.build in interface Builder<ActionAttributes>ActionAttributes object with the propertied stores in this builder.Copyright © 2021 Apache Software Foundation. All rights reserved.