public static class PipelineOptionsFactory.Builder
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
<T extends PipelineOptions> |
as(java.lang.Class<T> klass)
Creates and returns an object which implements
<T> using the values configured on
this builder during construction. |
PipelineOptions |
create()
Creates and returns an object which implements
PipelineOptions using the values
configured on this builder during construction. |
PipelineOptionsFactory.Builder |
fromArgs(java.lang.String[] args)
Sets the command line arguments to parse when constructing the
PipelineOptions. |
PipelineOptionsFactory.Builder |
withValidation()
After creation we will validate that
PipelineOptions conforms to all the
validation criteria from <T>. |
public PipelineOptionsFactory.Builder fromArgs(java.lang.String[] args)
PipelineOptions.
Example GNU style command line arguments:
--project=MyProject (simple property, will set the "project" property to "MyProject") --readOnly=true (for boolean properties, will set the "readOnly" property to "true") --readOnly (shorthand for boolean properties, will set the "readOnly" property to "true") --x=1 --x=2 --x=3 (list style property, will set the "x" property to [1, 2, 3]) --x=1,2,3 (shorthand list style property, will set the "x" property to [1, 2, 3])Properties are able to bound to
String and Java primitives boolean,
byte, short, int, long, float, double and
their primitive wrapper classes.
List style properties are able to be bound to boolean[], char[],
short[], int[], long[], float[], double[],
String[] and List<String>.
public PipelineOptionsFactory.Builder withValidation()
PipelineOptions conforms to all the
validation criteria from <T>. See
PipelineOptionsValidator.validate(Class, PipelineOptions) for more details about
validation.public PipelineOptions create()
PipelineOptions using the values
configured on this builder during construction.PipelineOptions.public <T extends PipelineOptions> T as(java.lang.Class<T> klass)
<T> using the values configured on
this builder during construction.
Note that <T> must be composable with every registered interface with this factory.
See PipelineOptionsFactory.validateWellFormed(Class, Set) for more details.
<T>.