Package io.protostuff.compiler.model
Class ImmutableModuleConfiguration
- java.lang.Object
-
- io.protostuff.compiler.model.ImmutableModuleConfiguration
-
- All Implemented Interfaces:
ModuleConfiguration
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableModuleConfiguration extends Object implements ModuleConfiguration
Immutable implementation ofModuleConfiguration.Use the builder to create immutable instances:
ImmutableModuleConfiguration.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableModuleConfiguration.BuilderBuilds instances of typeImmutableModuleConfiguration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableModuleConfiguration.Builderbuilder()Creates a builder forImmutableModuleConfiguration.static ImmutableModuleConfigurationcopyOf(ModuleConfiguration instance)Creates an immutable copy of aModuleConfigurationvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableModuleConfigurationthat have equal attribute values.StringgetGenerator()Generator used to compile proto files.com.google.common.collect.ImmutableList<Path>getIncludePaths()List of "include" folders used to search for proto files.StringgetName()Module name.com.google.common.collect.ImmutableMap<String,Object>getOptions()Map of custom settings passed to the generator.StringgetOutput()Output directory.com.google.common.collect.ImmutableList<String>getProtoFiles()List of proto files to compile.inthashCode()Computes a hash code from attributes:name,includePaths,protoFiles,generator,output,options.StringtoString()Prints the immutable valueModuleConfigurationwith attribute values.ImmutableModuleConfigurationwithGenerator(String value)Copy the current immutable object by setting a value for thegeneratorattribute.ImmutableModuleConfigurationwithIncludePaths(Iterable<? extends Path> elements)Copy the current immutable object with elements that replace the content ofincludePaths.ImmutableModuleConfigurationwithIncludePaths(Path... elements)Copy the current immutable object with elements that replace the content ofincludePaths.ImmutableModuleConfigurationwithName(String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableModuleConfigurationwithOptions(Map<String,? extends Object> entries)Copy the current immutable object by replacing theoptionsmap with the specified map.ImmutableModuleConfigurationwithOutput(String value)Copy the current immutable object by setting a value for theoutputattribute.ImmutableModuleConfigurationwithProtoFiles(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofprotoFiles.ImmutableModuleConfigurationwithProtoFiles(String... elements)Copy the current immutable object with elements that replace the content ofprotoFiles.
-
-
-
Method Detail
-
getName
public String getName()
Module name.- Specified by:
getNamein interfaceModuleConfiguration
-
getIncludePaths
public com.google.common.collect.ImmutableList<Path> getIncludePaths()
List of "include" folders used to search for proto files.- Specified by:
getIncludePathsin interfaceModuleConfiguration
-
getProtoFiles
public com.google.common.collect.ImmutableList<String> getProtoFiles()
List of proto files to compile.- Specified by:
getProtoFilesin interfaceModuleConfiguration
-
getGenerator
public String getGenerator()
Generator used to compile proto files. Currently following generators are supported:java- produces Java source code that uses protostuff runtime;html- produces HTML documentation;st4- generic generator, you should provide custom template (StringTemplate 4) using getOptions().
- Specified by:
getGeneratorin interfaceModuleConfiguration
-
getOutput
public String getOutput()
Output directory.- Specified by:
getOutputin interfaceModuleConfiguration
-
getOptions
public com.google.common.collect.ImmutableMap<String,Object> getOptions()
Map of custom settings passed to the generator.- Specified by:
getOptionsin interfaceModuleConfiguration
-
withName
public final ImmutableModuleConfiguration withName(String value)
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withIncludePaths
public final ImmutableModuleConfiguration withIncludePaths(Path... elements)
Copy the current immutable object with elements that replace the content ofincludePaths.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withIncludePaths
public final ImmutableModuleConfiguration withIncludePaths(Iterable<? extends Path> elements)
Copy the current immutable object with elements that replace the content ofincludePaths. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of includePaths elements to set- Returns:
- A modified copy of
thisobject
-
withProtoFiles
public final ImmutableModuleConfiguration withProtoFiles(String... elements)
Copy the current immutable object with elements that replace the content ofprotoFiles.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withProtoFiles
public final ImmutableModuleConfiguration withProtoFiles(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofprotoFiles. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of protoFiles elements to set- Returns:
- A modified copy of
thisobject
-
withGenerator
public final ImmutableModuleConfiguration withGenerator(String value)
Copy the current immutable object by setting a value for thegeneratorattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for generator- Returns:
- A modified copy of the
thisobject
-
withOutput
public final ImmutableModuleConfiguration withOutput(String value)
Copy the current immutable object by setting a value for theoutputattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for output- Returns:
- A modified copy of the
thisobject
-
withOptions
public final ImmutableModuleConfiguration withOptions(Map<String,? extends Object> entries)
Copy the current immutable object by replacing theoptionsmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the options map- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableModuleConfigurationthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,includePaths,protoFiles,generator,output,options.
-
toString
public String toString()
Prints the immutable valueModuleConfigurationwith attribute values.
-
copyOf
public static ImmutableModuleConfiguration copyOf(ModuleConfiguration instance)
Creates an immutable copy of aModuleConfigurationvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable ModuleConfiguration instance
-
builder
public static ImmutableModuleConfiguration.Builder builder()
Creates a builder forImmutableModuleConfiguration.ImmutableModuleConfiguration.builder() .name(String) // requiredname.addIncludePaths|addAllIncludePaths(java.nio.file.Path) //includePathselements .addProtoFiles|addAllProtoFiles(String) //protoFileselements .generator(String) // requiredgenerator.output(String) // requiredoutput.putOptions|putAllOptions(String => Object) //optionsmappings .build();- Returns:
- A new ImmutableModuleConfiguration builder
-
-