Class Property_Builder

  • Direct Known Subclasses:
    Property.Builder

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

      • type

        private javax.lang.model.type.TypeMirror type
      • boxedType

        private javax.lang.model.type.TypeMirror boxedType
      • name

        private java.lang.String name
      • capitalizedName

        private java.lang.String capitalizedName
      • allCapsName

        private java.lang.String allCapsName
      • usingBeanConvention

        private boolean usingBeanConvention
      • inToString

        private boolean inToString
      • inEqualsAndHashCode

        private boolean inEqualsAndHashCode
      • getterName

        private java.lang.String getterName
      • fullyCheckedCast

        private boolean fullyCheckedCast
      • accessorAnnotations

        private java.util.List<Excerpt> accessorAnnotations
      • getterAnnotations

        private java.util.List<Excerpt> getterAnnotations
      • putAnnotations

        private java.util.List<Excerpt> putAnnotations
    • Constructor Detail

      • Property_Builder

        Property_Builder()
    • Method Detail

      • from

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

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

      • setType

        public Property.Builder setType​(javax.lang.model.type.TypeMirror type)
        Sets the value to be returned by Property.getType().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if type is null
      • mapType

        public Property.Builder mapType​(java.util.function.UnaryOperator<javax.lang.model.type.TypeMirror> mapper)
        Replaces the value to be returned by Property.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 javax.lang.model.type.TypeMirror getType()
        Returns the value that will be returned by Property.getType().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • setBoxedType

        public Property.Builder setBoxedType​(javax.lang.model.type.TypeMirror boxedType)
        Sets the value to be returned by Property.getBoxedType().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if boxedType is null
      • setBoxedType

        public Property.Builder setBoxedType​(java.util.Optional<? extends javax.lang.model.type.TypeMirror> boxedType)
        Sets the value to be returned by Property.getBoxedType().
        Returns:
        this Builder object
      • setNullableBoxedType

        public Property.Builder setNullableBoxedType​(javax.lang.model.type.TypeMirror boxedType)
        Sets the value to be returned by Property.getBoxedType().
        Returns:
        this Builder object
      • mapBoxedType

        public Property.Builder mapBoxedType​(java.util.function.UnaryOperator<javax.lang.model.type.TypeMirror> mapper)
        If the value to be returned by Property.getBoxedType() 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
      • getBoxedType

        public java.util.Optional<javax.lang.model.type.TypeMirror> getBoxedType()
        Returns the value that will be returned by Property.getBoxedType().
      • setName

        public Property.Builder setName​(java.lang.String name)
        Sets the value to be returned by Property.getName().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if name is null
      • mapName

        public Property.Builder mapName​(java.util.function.UnaryOperator<java.lang.String> mapper)
        Replaces the value to be returned by Property.getName() 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
      • getName

        public java.lang.String getName()
        Returns the value that will be returned by Property.getName().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • setCapitalizedName

        public Property.Builder setCapitalizedName​(java.lang.String capitalizedName)
        Sets the value to be returned by Property.getCapitalizedName().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if capitalizedName is null
      • mapCapitalizedName

        public Property.Builder mapCapitalizedName​(java.util.function.UnaryOperator<java.lang.String> mapper)
        Replaces the value to be returned by Property.getCapitalizedName() 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
      • getCapitalizedName

        public java.lang.String getCapitalizedName()
        Returns the value that will be returned by Property.getCapitalizedName().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • setAllCapsName

        public Property.Builder setAllCapsName​(java.lang.String allCapsName)
        Sets the value to be returned by Property.getAllCapsName().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if allCapsName is null
      • mapAllCapsName

        public Property.Builder mapAllCapsName​(java.util.function.UnaryOperator<java.lang.String> mapper)
        Replaces the value to be returned by Property.getAllCapsName() 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
      • getAllCapsName

        public java.lang.String getAllCapsName()
        Returns the value that will be returned by Property.getAllCapsName().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mapUsingBeanConvention

        public Property.Builder mapUsingBeanConvention​(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
        Replaces the value to be returned by Property.isUsingBeanConvention() 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
      • isUsingBeanConvention

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

        public Property.Builder mapInToString​(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
        Replaces the value to be returned by Property.isInToString() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
      • mapInEqualsAndHashCode

        public Property.Builder mapInEqualsAndHashCode​(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
        Replaces the value to be returned by Property.isInEqualsAndHashCode() by applying mapper to it and using the result.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if mapper is null or returns null
      • setGetterName

        public Property.Builder setGetterName​(java.lang.String getterName)
        Sets the value to be returned by Property.getGetterName().
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if getterName is null
      • mapGetterName

        public Property.Builder mapGetterName​(java.util.function.UnaryOperator<java.lang.String> mapper)
        Replaces the value to be returned by Property.getGetterName() 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
      • getGetterName

        public java.lang.String getGetterName()
        Returns the value that will be returned by Property.getGetterName().
        Throws:
        java.lang.IllegalStateException - if the field has not been set
      • mapFullyCheckedCast

        public Property.Builder mapFullyCheckedCast​(java.util.function.UnaryOperator<java.lang.Boolean> mapper)
        Replaces the value to be returned by Property.isFullyCheckedCast() 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
      • isFullyCheckedCast

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

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

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

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

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

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

        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
      • getAccessorAnnotations

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

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

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

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

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

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

        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
      • getGetterAnnotations

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

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

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

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

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

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

        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
      • getPutAnnotations

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

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

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

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

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

        public Property buildPartial()
        Returns a newly-created partial Property 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(org.inferred.freebuilder.processor.property.Property) 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.