Class ImmutableModuleConfiguration

  • All Implemented Interfaces:
    ModuleConfiguration

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableModuleConfiguration
    extends Object
    implements ModuleConfiguration
    Immutable implementation of ModuleConfiguration.

    Use the builder to create immutable instances: ImmutableModuleConfiguration.builder().

    • Method Detail

      • getIncludePaths

        public com.google.common.collect.ImmutableList<Path> getIncludePaths()
        List of "include" folders used to search for proto files.
        Specified by:
        getIncludePaths in interface ModuleConfiguration
      • 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:
        getGenerator in interface ModuleConfiguration
      • withName

        public final ImmutableModuleConfiguration withName​(String value)
        Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for name
        Returns:
        A modified copy of the this object
      • withIncludePaths

        public final ImmutableModuleConfiguration withIncludePaths​(Path... elements)
        Copy the current immutable object with elements that replace the content of includePaths.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withIncludePaths

        public final ImmutableModuleConfiguration withIncludePaths​(Iterable<? extends Path> elements)
        Copy the current immutable object with elements that replace the content of includePaths. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of includePaths elements to set
        Returns:
        A modified copy of this object
      • withProtoFiles

        public final ImmutableModuleConfiguration withProtoFiles​(String... elements)
        Copy the current immutable object with elements that replace the content of protoFiles.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withProtoFiles

        public final ImmutableModuleConfiguration withProtoFiles​(Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of protoFiles. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of protoFiles elements to set
        Returns:
        A modified copy of this object
      • withGenerator

        public final ImmutableModuleConfiguration withGenerator​(String value)
        Copy the current immutable object by setting a value for the generator attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for generator
        Returns:
        A modified copy of the this object
      • withOutput

        public final ImmutableModuleConfiguration withOutput​(String value)
        Copy the current immutable object by setting a value for the output attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for output
        Returns:
        A modified copy of the this object
      • withOptions

        public final ImmutableModuleConfiguration withOptions​(Map<String,​? extends Object> entries)
        Copy the current immutable object by replacing the options map 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 returning this.
        Parameters:
        entries - The entries to be added to the options map
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableModuleConfiguration that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: name, includePaths, protoFiles, generator, output, options.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value ModuleConfiguration with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableModuleConfiguration copyOf​(ModuleConfiguration instance)
        Creates an immutable copy of a ModuleConfiguration value. 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