Class ImmutableDescriptorFileProtocTarget.Builder
java.lang.Object
io.github.ascopes.protobufmavenplugin.protoc.targets.ImmutableDescriptorFileProtocTarget.Builder
- Enclosing class:
ImmutableDescriptorFileProtocTarget
Builds instances of type
ImmutableDescriptorFileProtocTarget
.
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 newImmutableDescriptorFileProtocTarget
.from
(DescriptorFileProtocTarget instance) Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.protoc.targets.DescriptorFileProtocTarget
instance.from
(ProtocTarget instance) Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.protoc.targets.ProtocTarget
instance.includeImports
(boolean includeImports) Initializes the value for theincludeImports
attribute.includeSourceInfo
(boolean includeSourceInfo) Initializes the value for theincludeSourceInfo
attribute.order
(int order) Initializes the value for theorder
attribute.outputFile
(Path outputFile) Initializes the value for theoutputFile
attribute.retainOptions
(boolean retainOptions) Initializes the value for theretainOptions
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.protoc.targets.ProtocTarget
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedio.github.ascopes.protobufmavenplugin.protoc.targets.DescriptorFileProtocTarget
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
order
-
outputFile
Initializes the value for theoutputFile
attribute.- Parameters:
outputFile
- The value for outputFile (can benull
)- Returns:
this
builder for use in a chained invocation
-
includeImports
Initializes the value for theincludeImports
attribute.- Parameters:
includeImports
- The value for includeImports- Returns:
this
builder for use in a chained invocation
-
includeSourceInfo
public final ImmutableDescriptorFileProtocTarget.Builder includeSourceInfo(boolean includeSourceInfo) Initializes the value for theincludeSourceInfo
attribute.- Parameters:
includeSourceInfo
- The value for includeSourceInfo- Returns:
this
builder for use in a chained invocation
-
retainOptions
Initializes the value for theretainOptions
attribute.- Parameters:
retainOptions
- The value for retainOptions- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableDescriptorFileProtocTarget
.- Returns:
- An immutable instance of DescriptorFileProtocTarget
- Throws:
IllegalStateException
- if any required attributes are missing
-