Class ImmutableProtoFileListing.Builder
java.lang.Object
io.github.ascopes.protobufmavenplugin.sources.ImmutableProtoFileListing.Builder
- Enclosing class:
ImmutableProtoFileListing
Builds instances of type
ImmutableProtoFileListing
.
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 TypeMethodDescriptionaddAllProtoFiles
(Iterable<? extends Path> elements) Adds elements toprotoFiles
set.addProtoFiles
(Path element) Adds one element toprotoFiles
set.addProtoFiles
(Path... elements) Adds elements toprotoFiles
set.build()
Builds a newImmutableProtoFileListing
.from
(ProtoFileListing instance) Fill a builder with attribute values from the providedProtoFileListing
instance.protoFiles
(Iterable<? extends Path> elements) Sets or replaces all elements forprotoFiles
set.protoFilesRoot
(Path protoFilesRoot) Initializes the value for theprotoFilesRoot
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedProtoFileListing
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
protoFilesRoot
Initializes the value for theprotoFilesRoot
attribute.- Parameters:
protoFilesRoot
- The value for protoFilesRoot (can benull
)- Returns:
this
builder for use in a chained invocation
-
addProtoFiles
Adds one element toprotoFiles
set.- Parameters:
element
- A protoFiles element- Returns:
this
builder for use in a chained invocation
-
addProtoFiles
Adds elements toprotoFiles
set.- Parameters:
elements
- An array of protoFiles elements- Returns:
this
builder for use in a chained invocation
-
protoFiles
Sets or replaces all elements forprotoFiles
set.- Parameters:
elements
- An iterable of protoFiles elements- Returns:
this
builder for use in a chained invocation
-
addAllProtoFiles
Adds elements toprotoFiles
set.- Parameters:
elements
- An iterable of protoFiles elements- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableProtoFileListing
.- Returns:
- An immutable instance of ProtoFileListing
- Throws:
IllegalStateException
- if any required attributes are missing
-