Class ImmutableFacet.Builder

  • Enclosing class:
    ImmutableFacet

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

      • INIT_BIT_INTERFACE_TYPE

        private static final long INIT_BIT_INTERFACE_TYPE
        See Also:
        Constant Field Values
      • initBits

        private long initBits
      • name

        @Nullable
        private java.lang.String name
      • interfaceType

        @Nullable
        private javax.lang.model.type.TypeMirror interfaceType
      • fieldType

        @Nullable
        private javax.lang.model.type.TypeMirror fieldType
    • Constructor Detail

      • Builder

        private Builder()
    • Method Detail

      • name

        public final ImmutableFacet.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
      • interfaceType

        public final ImmutableFacet.Builder interfaceType​(javax.lang.model.type.TypeMirror interfaceType)
        Initializes the value for the interfaceType attribute.
        Parameters:
        interfaceType - The value for interfaceType
        Returns:
        this builder for use in a chained invocation
      • fieldType

        public final ImmutableFacet.Builder fieldType​(javax.lang.model.type.TypeMirror fieldType)
        Initializes the value for the fieldType attribute.
        Parameters:
        fieldType - The value for fieldType
        Returns:
        this builder for use in a chained invocation
      • build

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

        private boolean nameIsSet()
      • interfaceTypeIsSet

        private boolean interfaceTypeIsSet()
      • fieldTypeIsSet

        private boolean fieldTypeIsSet()
      • constructorIsSet

        private boolean constructorIsSet()
      • checkNotIsSet

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

        private void checkRequiredAttributes()
      • formatRequiredAttributesMessage

        private java.lang.String formatRequiredAttributesMessage()