Class AttributeBuilderDescriptor

java.lang.Object
org.immutables.value.processor.meta.AttributeBuilderDescriptor
Direct Known Subclasses:
ImmutableAttributeBuilderDescriptor

@Immutable public abstract class AttributeBuilderDescriptor extends Object
API for the template to use.
  • Constructor Details

    • AttributeBuilderDescriptor

      public AttributeBuilderDescriptor()
  • Method Details

    • getValueToBuilderTarget

      public abstract AttributeBuilderDescriptor.ValueToBuilderTarget getValueToBuilderTarget()
    • getValueToBuilderMethod

      protected abstract String getValueToBuilderMethod()
      A method name which when invoked will return a builder with all the properties set from the value object. This method will be invoked based on getValueToBuilderTarget()
      Returns:
      method to create a value instance. No () included.
    • getQualifiedValueToBuilderMethod

      public String getQualifiedValueToBuilderMethod()
      Uses getValueToBuilderTarget() to determine appropriate format for creating a new builder from a value object. The template needs to still query isCopyMethodOnValueInstance() to determine whether to use [expression].[n.getQualifiedValueToBuilderMethod]() vs [n.getQualifiedValueToBuilderMethod]([expression])
      Returns:
      method to use for converting a value to a builder.
    • isCopyMethodOnValueInstance

      public boolean isCopyMethodOnValueInstance()
      Helper for the template.
      Returns:
      if getValueToBuilderTarget() == AttributeBuilderDescriptor.ValueToBuilderTarget.VALUE_INSTANCE
    • getBuildMethod

      public abstract String getBuildMethod()
      A method to be invoked on the builder instance which returns a new value instance.
      Returns:
      a method which constructs a new value instance.
    • getQualifiedValueTypeName

      public abstract String getQualifiedValueTypeName()
      A fully qualified type for the value object.
      Returns:
      fully qualified name of the value type.
    • getQualifiedBuilderTypeName

      public abstract String getQualifiedBuilderTypeName()
      A fully qualified type for the builder object.
      Returns:
      fully qualified name of the builder type.
    • getQualifiedValueTypeNameWithUnderscores

      public String getQualifiedValueTypeNameWithUnderscores()
      Use to generate helper methods for a specific builder/value in a unique namespace.
      Returns:
      fully qualified name of the value type joined by underscores.
    • getQualifiedBuilderConstructorMethod

      public abstract String getQualifiedBuilderConstructorMethod()
      A fully qualified path and method which creates a new instance of a builder. If the builder is constructed from a no-arg constructor, the new keyword should be prepended with a space.
      Returns:
      static path which invoked will create a new empty builder. No () included.