Class ImmutableResolvedProtocPlugin.Builder
java.lang.Object
io.github.ascopes.protobufmavenplugin.plugins.ImmutableResolvedProtocPlugin.Builder
- Enclosing class:
ImmutableResolvedProtocPlugin
Builds instances of type
ImmutableResolvedProtocPlugin
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableResolvedProtocPlugin
.from
(ResolvedProtocPlugin instance) Fill a builder with attribute values from the providedResolvedProtocPlugin
instance.Initializes the value for theid
attribute.Initializes the optional valueoptions
to options.Initializes the optional valueoptions
to options.order
(int order) Initializes the value for theorder
attribute.outputDirectory
(Path outputDirectory) Initializes the value for theoutputDirectory
attribute.Initializes the value for thepath
attribute.registerAsCompilationRoot
(Boolean registerAsCompilationRoot) Initializes the optional valueregisterAsCompilationRoot
to registerAsCompilationRoot.registerAsCompilationRoot
(Optional<Boolean> registerAsCompilationRoot) Initializes the optional valueregisterAsCompilationRoot
to registerAsCompilationRoot.
-
Method Details
-
from
Fill a builder with attribute values from the providedResolvedProtocPlugin
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
id
Initializes the value for theid
attribute.- Parameters:
id
- The value for id (can benull
)- Returns:
this
builder for use in a chained invocation
-
options
Initializes the optional valueoptions
to options.- Parameters:
options
- The value for options,null
is accepted asjava.util.Optional.empty()
- Returns:
this
builder for chained invocation
-
options
Initializes the optional valueoptions
to options.- Parameters:
options
- The value for options- Returns:
this
builder for use in a chained invocation
-
order
Initializes the value for theorder
attribute.- Parameters:
order
- The value for order- Returns:
this
builder for use in a chained invocation
-
outputDirectory
Initializes the value for theoutputDirectory
attribute.- Parameters:
outputDirectory
- The value for outputDirectory (can benull
)- Returns:
this
builder for use in a chained invocation
-
registerAsCompilationRoot
public final ImmutableResolvedProtocPlugin.Builder registerAsCompilationRoot(Boolean registerAsCompilationRoot) Initializes the optional valueregisterAsCompilationRoot
to registerAsCompilationRoot.- Parameters:
registerAsCompilationRoot
- The value for registerAsCompilationRoot,null
is accepted asjava.util.Optional.empty()
- Returns:
this
builder for chained invocation
-
registerAsCompilationRoot
public final ImmutableResolvedProtocPlugin.Builder registerAsCompilationRoot(Optional<Boolean> registerAsCompilationRoot) Initializes the optional valueregisterAsCompilationRoot
to registerAsCompilationRoot.- Parameters:
registerAsCompilationRoot
- The value for registerAsCompilationRoot- Returns:
this
builder for use in a chained invocation
-
path
Initializes the value for thepath
attribute.- Parameters:
path
- The value for path (can benull
)- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableResolvedProtocPlugin
.- Returns:
- An immutable instance of ResolvedProtocPlugin
- Throws:
IllegalStateException
- if any required attributes are missing
-