public static final class UsageDefinition.Builder extends Object
UsageDefinition
object. It exposes different methods that allow users to configure the TokenDefinition
for each token used within the usage of a directive.| Modifier and Type | Method and Description |
|---|---|
UsageDefinition |
build() |
void |
define(String name,
TokenType type)
This method provides a way to set the name and the type of token, while
defaulting the label to 'null' and setting the optional to FALSE.
|
void |
define(String name,
TokenType type,
boolean optional)
Method allows users to specify a field as optional in combination to the
name of the token and the type of token.
|
void |
define(String name,
TokenType type,
String label)
Allows users to define a token with a name, type of the token and additional optional
for the label that is used during creation of the usage for the directive.
|
void |
define(String name,
TokenType type,
String label,
boolean optional)
Method allows users to specify a field as optional in combination to the
name of the token, the type of token and also the ability to specify a label
for the usage.
|
public Builder(String directive)
public void define(String name, TokenType type)
name - of the token in the definition of a directive.type - of the token to be extracted.public void define(String name, TokenType type, String label)
name - of the token in the definition of a directive.type - of the token to be extracted.label - label that modifies the usage for this field.public void define(String name, TokenType type, boolean optional)
name - of the token in the definition of a directive.type - of the token to be extracted.optional - Optional#TRUE if token is optional, else Optional#FALSE.public void define(String name, TokenType type, String label, boolean optional)
name - of the token in the definition of a directive.type - of the token to be extracted.label - label that modifies the usage for this field.optional - Optional#TRUE if token is optional, else Optional#FALSE.public UsageDefinition build()
UsageDefinition object.Copyright © 2023 CDAP Licensed under the Apache License, Version 2.0.