Class BuildableType_Builder

    • Constructor Detail

      • BuildableType_Builder

        BuildableType_Builder()
    • Method Detail

      • from

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

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

      • mapType

        public BuildableType.Builder mapType​(java.util.function.UnaryOperator<Type> mapper)
        Replaces the value to be returned by BuildableType.type() 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
      • type

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

        public BuildableType.Builder mapBuilderType​(java.util.function.UnaryOperator<Type> mapper)
        Replaces the value to be returned by BuildableType.builderType() 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
      • builderType

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

        public BuildableType.Builder mapMergeBuilder​(java.util.function.UnaryOperator<BuildableType.MergeBuilderMethod> mapper)
        Replaces the value to be returned by BuildableType.mergeBuilder() 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
      • mapBuilderFactory

        public BuildableType.Builder mapBuilderFactory​(java.util.function.UnaryOperator<BuilderFactory> mapper)
        Replaces the value to be returned by BuildableType.builderFactory() 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
      • mapSuppressUnchecked

        public BuildableType.Builder mapSuppressUnchecked​(java.util.function.UnaryOperator<Excerpt> mapper)
        Replaces the value to be returned by BuildableType.suppressUnchecked() 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
      • suppressUnchecked

        public Excerpt suppressUnchecked()
        Returns the value that will be returned by BuildableType.suppressUnchecked().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • clear

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

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

        public BuildableType buildPartial()
        Returns a newly-created partial BuildableType 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(BuildableType) 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.