Class ImmutableMavenProtocPlugin.Builder

java.lang.Object
io.github.ascopes.protobufmavenplugin.plugins.ImmutableMavenProtocPlugin.Builder
Enclosing class:
ImmutableMavenProtocPlugin

public static final class ImmutableMavenProtocPlugin.Builder extends Object
Builds instances of type ImmutableMavenProtocPlugin. 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.

  • Field Details

    • INIT_BIT_GROUP_ID

      private static final long INIT_BIT_GROUP_ID
      See Also:
    • INIT_BIT_ARTIFACT_ID

      private static final long INIT_BIT_ARTIFACT_ID
      See Also:
    • INIT_BIT_VERSION

      private static final long INIT_BIT_VERSION
      See Also:
    • OPT_BIT_ORDER

      private static final long OPT_BIT_ORDER
      See Also:
    • OPT_BIT_IS_SKIP

      private static final long OPT_BIT_IS_SKIP
      See Also:
    • initBits

      private long initBits
    • optBits

      private long optBits
    • groupId

      private String groupId
    • artifactId

      private String artifactId
    • type

      private @Nullable String type
    • classifier

      private @Nullable String classifier
    • exclusions

      private List<MavenExclusionBean> exclusions
    • options

      private @Nullable String options
    • order

      private int order
    • isSkip

      private boolean isSkip
    • version

      private @NonNull String version
    • jvmArgs

      private List<String> jvmArgs
    • jvmConfigArgs

      private List<String> jvmConfigArgs
    • mainClass

      private @Nullable String mainClass
  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • from

      Fill a builder with attribute values from the provided MavenProtocPluginBean 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 provided io.github.ascopes.protobufmavenplugin.plugins.MavenProtocPlugin instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final ImmutableMavenProtocPlugin.Builder from(ProtocPlugin instance)
      Fill a builder with attribute values from the provided io.github.ascopes.protobufmavenplugin.plugins.ProtocPlugin instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      public final ImmutableMavenProtocPlugin.Builder from(MavenArtifact instance)
      Fill a builder with attribute values from the provided io.github.ascopes.protobufmavenplugin.dependencies.MavenArtifact instance.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • from

      private void from(short _unused, Object object)
    • groupId

      public final ImmutableMavenProtocPlugin.Builder groupId(String groupId)
      Initializes the value for the groupId attribute.
      Parameters:
      groupId - The value for groupId (can be null)
      Returns:
      this builder for use in a chained invocation
    • artifactId

      public final ImmutableMavenProtocPlugin.Builder artifactId(String artifactId)
      Initializes the value for the artifactId attribute.
      Parameters:
      artifactId - The value for artifactId (can be null)
      Returns:
      this builder for use in a chained invocation
    • type

      public final ImmutableMavenProtocPlugin.Builder type(@Nullable String type)
      Initializes the value for the type attribute.
      Parameters:
      type - The value for type (can be null)
      Returns:
      this builder for use in a chained invocation
    • classifier

      public final ImmutableMavenProtocPlugin.Builder classifier(@Nullable String classifier)
      Initializes the value for the classifier attribute.
      Parameters:
      classifier - The value for classifier (can be null)
      Returns:
      this builder for use in a chained invocation
    • addExclusions

      public final ImmutableMavenProtocPlugin.Builder addExclusions(MavenExclusionBean element)
      Adds one element to exclusions set.
      Parameters:
      element - A exclusions element
      Returns:
      this builder for use in a chained invocation
    • addExclusions

      public final ImmutableMavenProtocPlugin.Builder addExclusions(MavenExclusionBean... elements)
      Adds elements to exclusions set.
      Parameters:
      elements - An array of exclusions elements
      Returns:
      this builder for use in a chained invocation
    • exclusions

      public final ImmutableMavenProtocPlugin.Builder exclusions(Iterable<? extends MavenExclusionBean> elements)
      Sets or replaces all elements for exclusions set.
      Parameters:
      elements - An iterable of exclusions elements
      Returns:
      this builder for use in a chained invocation
    • addAllExclusions

      public final ImmutableMavenProtocPlugin.Builder addAllExclusions(Iterable<? extends MavenExclusionBean> elements)
      Adds elements to exclusions set.
      Parameters:
      elements - An iterable of exclusions elements
      Returns:
      this builder for use in a chained invocation
    • options

      public final ImmutableMavenProtocPlugin.Builder options(@Nullable String options)
      Initializes the value for the options attribute.
      Parameters:
      options - The value for options (can be null)
      Returns:
      this builder for use in a chained invocation
    • order

      public final ImmutableMavenProtocPlugin.Builder order(int order)
      Initializes the value for the order attribute.

      If not set, this attribute will have a default value as returned by the initializer of order.

      Parameters:
      order - The value for order
      Returns:
      this builder for use in a chained invocation
    • isSkip

      public final ImmutableMavenProtocPlugin.Builder isSkip(boolean isSkip)
      Initializes the value for the isSkip attribute.

      If not set, this attribute will have a default value as returned by the initializer of isSkip.

      Parameters:
      isSkip - The value for isSkip
      Returns:
      this builder for use in a chained invocation
    • version

      public final ImmutableMavenProtocPlugin.Builder version(@NonNull String version)
      Initializes the value for the version attribute.
      Parameters:
      version - The value for version (can be null)
      Returns:
      this builder for use in a chained invocation
    • addJvmArgs

      public final ImmutableMavenProtocPlugin.Builder addJvmArgs(String element)
      Adds one element to jvmArgs list.
      Parameters:
      element - A jvmArgs element
      Returns:
      this builder for use in a chained invocation
    • addJvmArgs

      public final ImmutableMavenProtocPlugin.Builder addJvmArgs(String... elements)
      Adds elements to jvmArgs list.
      Parameters:
      elements - An array of jvmArgs elements
      Returns:
      this builder for use in a chained invocation
    • jvmArgs

      public final ImmutableMavenProtocPlugin.Builder jvmArgs(Iterable<String> elements)
      Sets or replaces all elements for jvmArgs list.
      Parameters:
      elements - An iterable of jvmArgs elements
      Returns:
      this builder for use in a chained invocation
    • addAllJvmArgs

      public final ImmutableMavenProtocPlugin.Builder addAllJvmArgs(Iterable<String> elements)
      Adds elements to jvmArgs list.
      Parameters:
      elements - An iterable of jvmArgs elements
      Returns:
      this builder for use in a chained invocation
    • addJvmConfigArgs

      public final ImmutableMavenProtocPlugin.Builder addJvmConfigArgs(String element)
      Adds one element to jvmConfigArgs list.
      Parameters:
      element - A jvmConfigArgs element
      Returns:
      this builder for use in a chained invocation
    • addJvmConfigArgs

      public final ImmutableMavenProtocPlugin.Builder addJvmConfigArgs(String... elements)
      Adds elements to jvmConfigArgs list.
      Parameters:
      elements - An array of jvmConfigArgs elements
      Returns:
      this builder for use in a chained invocation
    • jvmConfigArgs

      public final ImmutableMavenProtocPlugin.Builder jvmConfigArgs(Iterable<String> elements)
      Sets or replaces all elements for jvmConfigArgs list.
      Parameters:
      elements - An iterable of jvmConfigArgs elements
      Returns:
      this builder for use in a chained invocation
    • addAllJvmConfigArgs

      public final ImmutableMavenProtocPlugin.Builder addAllJvmConfigArgs(Iterable<String> elements)
      Adds elements to jvmConfigArgs list.
      Parameters:
      elements - An iterable of jvmConfigArgs elements
      Returns:
      this builder for use in a chained invocation
    • mainClass

      public final ImmutableMavenProtocPlugin.Builder mainClass(@Nullable String mainClass)
      Initializes the value for the mainClass attribute.
      Parameters:
      mainClass - The value for mainClass (can be null)
      Returns:
      this builder for use in a chained invocation
    • build

      Returns:
      An immutable instance of MavenProtocPlugin
      Throws:
      IllegalStateException - if any required attributes are missing
    • orderIsSet

      private boolean orderIsSet()
    • isSkipIsSet

      private boolean isSkipIsSet()
    • formatRequiredAttributesMessage

      private String formatRequiredAttributesMessage()