Class ImmutableEncodedElement.TypeParam.Builder

  • Direct Known Subclasses:
    EncodedElement.TypeParam.Builder
    Enclosing class:
    ImmutableEncodedElement.TypeParam

    @NotThreadSafe
    public static class ImmutableEncodedElement.TypeParam.Builder
    extends java.lang.Object
    Builds instances of type TypeParam. 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 Detail

      • initBits

        private long initBits
      • name

        @Nullable
        private java.lang.String name
      • bounds

        private final com.google.common.collect.ImmutableList.Builder<Type.Defined> bounds
    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder for TypeParam instances.
         new EncodedElement.TypeParam.Builder()
            .name(String) // required name
            .addBounds|addAllBounds(org.immutables.value.processor.encode.Type.Defined) // bounds elements
            .build();
         
    • Method Detail

      • name

        public final EncodedElement.TypeParam.Builder name​(java.lang.String name)
        Initializes the value for the name attribute.
        Parameters:
        name - The value for name
        Returns:
        this builder for use in a chained invocation
      • addAllBounds

        public final EncodedElement.TypeParam.Builder addAllBounds​(java.lang.Iterable<? extends Type.Defined> elements)
        Adds elements to bounds list.
        Parameters:
        elements - An iterable of bounds elements
        Returns:
        this builder for use in a chained invocation
      • build

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

        private boolean nameIsSet()
      • checkNotIsSet

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

        private void checkRequiredAttributes()
      • formatRequiredAttributesMessage

        private java.lang.String formatRequiredAttributesMessage()