Enum BuilderFactory

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<BuilderFactory>

    public enum BuilderFactory
    extends java.lang.Enum<BuilderFactory>
    Standard ways of constructing a default Builder.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BUILDER_METHOD
      The enclosing class provides a static builder() factory method.
      NEW_BUILDER_METHOD
      The enclosing class provides a static newBuilder() factory method.
      NO_ARGS_CONSTRUCTOR
      A new Builder can be made by calling the class' no-args constructor.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private BuilderFactory()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      private static com.google.common.collect.ImmutableSet<java.lang.String> findPotentialStaticFactoryMethods​(javax.lang.model.element.TypeElement builderType)  
      static java.util.Optional<BuilderFactory> from​(javax.lang.model.element.TypeElement builderType)
      Determines the correct way of constructing a default builderType instance, if any.
      (package private) static boolean hasNoArgsConstructor​(javax.lang.model.element.TypeElement type)  
      abstract Excerpt newBuilder​(Type builderType, BuilderFactory.TypeInference typeInference)
      Returns an excerpt calling the Builder factory method.
      private static boolean typeIsAbstract​(javax.lang.model.element.TypeElement type)  
      static BuilderFactory valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static BuilderFactory[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NO_ARGS_CONSTRUCTOR

        public static final BuilderFactory NO_ARGS_CONSTRUCTOR
        A new Builder can be made by calling the class' no-args constructor.
      • BUILDER_METHOD

        public static final BuilderFactory BUILDER_METHOD
        The enclosing class provides a static builder() factory method.
      • NEW_BUILDER_METHOD

        public static final BuilderFactory NEW_BUILDER_METHOD
        The enclosing class provides a static newBuilder() factory method.
    • Constructor Detail

      • BuilderFactory

        private BuilderFactory()
    • Method Detail

      • values

        public static BuilderFactory[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (BuilderFactory c : BuilderFactory.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BuilderFactory valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • from

        public static java.util.Optional<BuilderFactory> from​(javax.lang.model.element.TypeElement builderType)
        Determines the correct way of constructing a default builderType instance, if any.
      • typeIsAbstract

        private static boolean typeIsAbstract​(javax.lang.model.element.TypeElement type)
      • hasNoArgsConstructor

        static boolean hasNoArgsConstructor​(javax.lang.model.element.TypeElement type)
      • findPotentialStaticFactoryMethods

        private static com.google.common.collect.ImmutableSet<java.lang.String> findPotentialStaticFactoryMethods​(javax.lang.model.element.TypeElement builderType)