Class Datatype_Builder

  • Direct Known Subclasses:
    Datatype.Builder

    @Generated("org.inferred.freebuilder.processor.Processor")
    abstract class Datatype_Builder
    extends java.lang.Object
    Auto-generated superclass of Datatype.Builder, derived from the API of Datatype.
    • Constructor Detail

      • Datatype_Builder

        Datatype_Builder()
    • Method Detail

      • from

        public static Datatype.Builder from​(Datatype value)
        Creates a new builder using value as a template.

        If value is a partial, the builder will return more partials.

      • mapType

        public Datatype.Builder mapType​(java.util.function.UnaryOperator<TypeClass> mapper)
        Replaces the value to be returned by Datatype.getType() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • getType

        public TypeClass getType()
        Returns the value that will be returned by Datatype.getType().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mapInterfaceType

        public Datatype.Builder mapInterfaceType​(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
        Replaces the value to be returned by Datatype.isInterfaceType() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • isInterfaceType

        public boolean isInterfaceType()
        Returns the value that will be returned by Datatype.isInterfaceType().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • setBuilder

        public Datatype.Builder setBuilder​(Type builder)
        Sets the value to be returned by Datatype.getBuilder().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if builder is null
      • mapBuilder

        public Datatype.Builder mapBuilder​(java.util.function.UnaryOperator<Type> mapper)
        Replaces the value to be returned by Datatype.getBuilder() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • getBuilder

        public Type getBuilder()
        Returns the value that will be returned by Datatype.getBuilder().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mapExtensible

        public Datatype.Builder mapExtensible​(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
        Replaces the value to be returned by Datatype.isExtensible() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • isExtensible

        public boolean isExtensible()
        Returns the value that will be returned by Datatype.isExtensible().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mapBuilderFactory

        public Datatype.Builder mapBuilderFactory​(java.util.function.UnaryOperator<BuilderFactory> mapper)
        If the value to be returned by Datatype.getBuilderFactory() is present, replaces it by applying mapper to it and using the result.

        If the result is null, clears the value.

        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null
      • mapGeneratedBuilder

        public Datatype.Builder mapGeneratedBuilder​(java.util.function.UnaryOperator<TypeClass> mapper)
        Replaces the value to be returned by Datatype.getGeneratedBuilder() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • getGeneratedBuilder

        public TypeClass getGeneratedBuilder()
        Returns the value that will be returned by Datatype.getGeneratedBuilder().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mapValueType

        public Datatype.Builder mapValueType​(java.util.function.UnaryOperator<TypeClass> mapper)
        Replaces the value to be returned by Datatype.getValueType() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • getValueType

        public TypeClass getValueType()
        Returns the value that will be returned by Datatype.getValueType().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mapPartialType

        public Datatype.Builder mapPartialType​(java.util.function.UnaryOperator<TypeClass> mapper)
        Replaces the value to be returned by Datatype.getPartialType() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • getPartialType

        public TypeClass getPartialType()
        Returns the value that will be returned by Datatype.getPartialType().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mapRebuildableType

        public Datatype.Builder mapRebuildableType​(java.util.function.UnaryOperator<TypeClass> mapper)
        If the value to be returned by Datatype.getRebuildableType() is present, replaces it by applying mapper to it and using the result.

        If the result is null, clears the value.

        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null
      • mapPropertyEnum

        public Datatype.Builder mapPropertyEnum​(java.util.function.UnaryOperator<TypeClass> mapper)
        Replaces the value to be returned by Datatype.getPropertyEnum() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • getPropertyEnum

        public TypeClass getPropertyEnum()
        Returns the value that will be returned by Datatype.getPropertyEnum().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mutateStandardMethodUnderrides

        public Datatype.Builder mutateStandardMethodUnderrides​(java.util.function.Consumer<? super java.util.Map<Datatype.StandardMethod,​Datatype.UnderrideLevel>> mutator)
        Invokes mutator with the map to be returned from Datatype.getStandardMethodUnderrides().

        This method mutates the map in-place. mutator is a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, like Collection.stream().

        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mutator is null
      • mapBuilderSerializable

        public Datatype.Builder mapBuilderSerializable​(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
        Replaces the value to be returned by Datatype.isBuilderSerializable() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • isBuilderSerializable

        public boolean isBuilderSerializable()
        Returns the value that will be returned by Datatype.isBuilderSerializable().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mapHasToBuilderMethod

        public Datatype.Builder mapHasToBuilderMethod​(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
        Replaces the value to be returned by Datatype.getHasToBuilderMethod() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • getHasToBuilderMethod

        public boolean getHasToBuilderMethod()
        Returns the value that will be returned by Datatype.getHasToBuilderMethod().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mapBuildMethod

        public Datatype.Builder mapBuildMethod​(java.util.function.UnaryOperator<NameAndVisibility> mapper)
        Replaces the value to be returned by Datatype.getBuildMethod() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • mapBuildPartialMethod

        public Datatype.Builder mapBuildPartialMethod​(java.util.function.UnaryOperator<NameAndVisibility> mapper)
        Replaces the value to be returned by Datatype.getBuildPartialMethod() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • mapClearMethod

        public Datatype.Builder mapClearMethod​(java.util.function.UnaryOperator<NameAndVisibility> mapper)
        Replaces the value to be returned by Datatype.getClearMethod() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • mapMergeFromBuilderMethod

        public Datatype.Builder mapMergeFromBuilderMethod​(java.util.function.UnaryOperator<NameAndVisibility> mapper)
        Replaces the value to be returned by Datatype.getMergeFromBuilderMethod() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • mapMergeFromValueMethod

        public Datatype.Builder mapMergeFromValueMethod​(java.util.function.UnaryOperator<NameAndVisibility> mapper)
        Replaces the value to be returned by Datatype.getMergeFromValueMethod() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • addGeneratedBuilderAnnotations

        public Datatype.Builder addGeneratedBuilderAnnotations​(Excerpt... elements)
        Adds each element of elements to the list to be returned from Datatype.getGeneratedBuilderAnnotations().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addAllGeneratedBuilderAnnotations

        public Datatype.Builder addAllGeneratedBuilderAnnotations​(java.util.Spliterator<? extends Excerpt> elements)
        Adds each element of elements to the list to be returned from Datatype.getGeneratedBuilderAnnotations().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addAllGeneratedBuilderAnnotations

        public Datatype.Builder addAllGeneratedBuilderAnnotations​(java.util.stream.BaseStream<? extends Excerpt,​?> elements)
        Adds each element of elements to the list to be returned from Datatype.getGeneratedBuilderAnnotations().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addAllGeneratedBuilderAnnotations

        public Datatype.Builder addAllGeneratedBuilderAnnotations​(java.lang.Iterable<? extends Excerpt> elements)
        Adds each element of elements to the list to be returned from Datatype.getGeneratedBuilderAnnotations().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • mutateGeneratedBuilderAnnotations

        public Datatype.Builder mutateGeneratedBuilderAnnotations​(java.util.function.Consumer<? super java.util.List<Excerpt>> mutator)
        Applies mutator to the list to be returned from Datatype.getGeneratedBuilderAnnotations().

        This method mutates the list in-place. mutator is a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, like Collection.stream().

        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mutator is null
      • getGeneratedBuilderAnnotations

        public java.util.List<Excerpt> getGeneratedBuilderAnnotations()
        Returns an unmodifiable view of the list that will be returned by Datatype.getGeneratedBuilderAnnotations(). Changes to this builder will be reflected in the view.
      • addValueTypeAnnotations

        public Datatype.Builder addValueTypeAnnotations​(Excerpt... elements)
        Adds each element of elements to the list to be returned from Datatype.getValueTypeAnnotations().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addAllValueTypeAnnotations

        public Datatype.Builder addAllValueTypeAnnotations​(java.util.Spliterator<? extends Excerpt> elements)
        Adds each element of elements to the list to be returned from Datatype.getValueTypeAnnotations().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addAllValueTypeAnnotations

        public Datatype.Builder addAllValueTypeAnnotations​(java.util.stream.BaseStream<? extends Excerpt,​?> elements)
        Adds each element of elements to the list to be returned from Datatype.getValueTypeAnnotations().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addAllValueTypeAnnotations

        public Datatype.Builder addAllValueTypeAnnotations​(java.lang.Iterable<? extends Excerpt> elements)
        Adds each element of elements to the list to be returned from Datatype.getValueTypeAnnotations().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • mutateValueTypeAnnotations

        public Datatype.Builder mutateValueTypeAnnotations​(java.util.function.Consumer<? super java.util.List<Excerpt>> mutator)
        Applies mutator to the list to be returned from Datatype.getValueTypeAnnotations().

        This method mutates the list in-place. mutator is a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, like Collection.stream().

        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mutator is null
      • getValueTypeAnnotations

        public java.util.List<Excerpt> getValueTypeAnnotations()
        Returns an unmodifiable view of the list that will be returned by Datatype.getValueTypeAnnotations(). Changes to this builder will be reflected in the view.
      • mapValueTypeVisibility

        public Datatype.Builder mapValueTypeVisibility​(java.util.function.UnaryOperator<Datatype.Visibility> mapper)
        Replaces the value to be returned by Datatype.getValueTypeVisibility() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
        java.lang.IllegalStateException - if the field has not been set
      • addNestedClasses

        public Datatype.Builder addNestedClasses​(Excerpt... elements)
        Adds each element of elements to the list to be returned from Datatype.getNestedClasses().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addAllNestedClasses

        public Datatype.Builder addAllNestedClasses​(java.util.Spliterator<? extends Excerpt> elements)
        Adds each element of elements to the list to be returned from Datatype.getNestedClasses().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addAllNestedClasses

        public Datatype.Builder addAllNestedClasses​(java.util.stream.BaseStream<? extends Excerpt,​?> elements)
        Adds each element of elements to the list to be returned from Datatype.getNestedClasses().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addAllNestedClasses

        public Datatype.Builder addAllNestedClasses​(java.lang.Iterable<? extends Excerpt> elements)
        Adds each element of elements to the list to be returned from Datatype.getNestedClasses().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • mutateNestedClasses

        public Datatype.Builder mutateNestedClasses​(java.util.function.Consumer<? super java.util.List<Excerpt>> mutator)
        Applies mutator to the list to be returned from Datatype.getNestedClasses().

        This method mutates the list in-place. mutator is a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, like Collection.stream().

        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mutator is null
      • getNestedClasses

        public java.util.List<Excerpt> getNestedClasses()
        Returns an unmodifiable view of the list that will be returned by Datatype.getNestedClasses(). Changes to this builder will be reflected in the view.
      • mergeFrom

        public Datatype.Builder mergeFrom​(Datatype value)
        Copies values from value, appending to collections, and skipping empty optionals.
        Returns:
        this Builder object
      • mergeFrom

        public Datatype.Builder mergeFrom​(Datatype.Builder template)
        Copies values from template, appending to collections, and skipping empty optionals and unset properties.
        Returns:
        this Builder object
      • clear

        public Datatype.Builder clear()
        Resets the state of this builder.
        Returns:
        this Builder object
      • build

        public Datatype build()
        Returns a newly-created Datatype based on the contents of this Builder.
        Throws:
        java.lang.IllegalStateException - if any field has not been set
      • buildPartial

        public Datatype buildPartial()
        Returns a newly-created partial Datatype for use in unit tests. State checking will not be performed. Unset properties will throw an UnsupportedOperationException when accessed via the partial object.

        The builder returned by from(Datatype) will propagate the partial status of its input, overriding build() to return another partial. This allows for robust tests of modify-rebuild code.

        Partials should only ever be used in tests. They permit writing robust test cases that won't fail if this type gains more application-level constraints (e.g. new required fields) in future. If you require partially complete values in production code, consider using a Builder.