Class ImmutableSourceListing.Builder
java.lang.Object
io.github.ascopes.protobufmavenplugin.sources.ImmutableSourceListing.Builder
- Enclosing class:
ImmutableSourceListing
@Generated(from="SourceListing",
generator="Immutables")
public static final class ImmutableSourceListing.Builder
extends Object
Builds instances of type
ImmutableSourceListing.
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 TypeMethodDescriptionaddAllSourceFiles(Iterable<? extends @Nullable Path> elements) Adds elements tosourceFilesset.addSourceFiles(@Nullable Path element) Adds one element tosourceFilesset.addSourceFiles(@Nullable Path... elements) Adds elements tosourceFilesset.build()Builds a newImmutableSourceListing.from(SourceListing instance) Fill a builder with attribute values from the providedSourceListinginstance.sourceFiles(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forsourceFilesset.sourceRoot(Path sourceRoot) Initializes the value for thesourceRootattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedSourceListinginstance. 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:
thisbuilder for use in a chained invocation
-
sourceRoot
Initializes the value for thesourceRootattribute.- Parameters:
sourceRoot- The value for sourceRoot (can benull)- Returns:
thisbuilder for use in a chained invocation
-
addSourceFiles
Adds one element tosourceFilesset.- Parameters:
element- A sourceFiles element- Returns:
thisbuilder for use in a chained invocation
-
addSourceFiles
Adds elements tosourceFilesset.- Parameters:
elements- An array of sourceFiles elements- Returns:
thisbuilder for use in a chained invocation
-
sourceFiles
public final ImmutableSourceListing.Builder sourceFiles(Iterable<? extends @Nullable Path> elements) Sets or replaces all elements forsourceFilesset.- Parameters:
elements- An iterable of sourceFiles elements- Returns:
thisbuilder for use in a chained invocation
-
addAllSourceFiles
public final ImmutableSourceListing.Builder addAllSourceFiles(Iterable<? extends @Nullable Path> elements) Adds elements tosourceFilesset.- Parameters:
elements- An iterable of sourceFiles elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableSourceListing.- Returns:
- An immutable instance of SourceListing
- Throws:
IllegalStateException- if any required attributes are missing
-