Class ImmutableProto.Protoclass.Builder

  • Enclosing class:
    ImmutableProto.Protoclass

    @NotThreadSafe
    public static final class ImmutableProto.Protoclass.Builder
    extends java.lang.Object
    Builds instances of type Protoclass. 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.

    • Constructor Detail

      • Builder

        private Builder()
    • Method Detail

      • sourceElement

        public final ImmutableProto.Protoclass.Builder sourceElement​(javax.lang.model.element.Element sourceElement)
        Initializes the value for the sourceElement attribute.
        Parameters:
        sourceElement - The value for sourceElement
        Returns:
        this builder for use in a chained invocation
      • declaringType

        public final ImmutableProto.Protoclass.Builder declaringType​(com.google.common.base.Optional<? extends Proto.DeclaringType> declaringType)
        Initializes the optional value declaringType to declaringType.
        Parameters:
        declaringType - The value for declaringType
        Returns:
        this builder for use in a chained invocation
      • build

        public ImmutableProto.Protoclass build()
        Builds a new Protoclass.
        Returns:
        An immutable instance of Protoclass
        Throws:
        java.lang.IllegalStateException - if any required attributes are missing
      • declaringTypeIsSet

        private boolean declaringTypeIsSet()
      • environmentIsSet

        private boolean environmentIsSet()
      • sourceElementIsSet

        private boolean sourceElementIsSet()
      • packageOfIsSet

        private boolean packageOfIsSet()
      • kindIsSet

        private boolean kindIsSet()
      • checkNotIsSet

        private static void checkNotIsSet​(boolean isSet,
                                          java.lang.String name)
      • checkRequiredAttributes

        private void checkRequiredAttributes()
      • formatRequiredAttributesMessage

        private java.lang.String formatRequiredAttributesMessage()