Class Property_Builder
- Direct Known Subclasses:
Property.Builder
invalid reference
Property.Builder
Property_Builder.Property.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static enumprivate static classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EnumSet<Property_Builder.Property> private Stringprivate TypeMirrorprivate Stringprivate booleanprivate Stringprivate booleanprivate booleanprivate Stringprivate TypeMirrorprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAccessorAnnotations(Excerpt element) Addselementto the list to be returned fromProperty.getAccessorAnnotations().addAccessorAnnotations(Excerpt... elements) Adds each element ofelementsto the list to be returned fromProperty.getAccessorAnnotations().addAllAccessorAnnotations(Iterable<? extends Excerpt> elements) Adds each element ofelementsto the list to be returned fromProperty.getAccessorAnnotations().addAllAccessorAnnotations(Spliterator<? extends Excerpt> elements) Adds each element ofelementsto the list to be returned fromProperty.getAccessorAnnotations().addAllAccessorAnnotations(BaseStream<? extends Excerpt, ?> elements) Adds each element ofelementsto the list to be returned fromProperty.getAccessorAnnotations().addAllGetterAnnotations(Iterable<? extends Excerpt> elements) Adds each element ofelementsto the list to be returned fromProperty.getGetterAnnotations().addAllGetterAnnotations(Spliterator<? extends Excerpt> elements) Adds each element ofelementsto the list to be returned fromProperty.getGetterAnnotations().addAllGetterAnnotations(BaseStream<? extends Excerpt, ?> elements) Adds each element ofelementsto the list to be returned fromProperty.getGetterAnnotations().addAllPutAnnotations(Iterable<? extends Excerpt> elements) Adds each element ofelementsto the list to be returned fromProperty.getPutAnnotations().addAllPutAnnotations(Spliterator<? extends Excerpt> elements) Adds each element ofelementsto the list to be returned fromProperty.getPutAnnotations().addAllPutAnnotations(BaseStream<? extends Excerpt, ?> elements) Adds each element ofelementsto the list to be returned fromProperty.getPutAnnotations().addGetterAnnotations(Excerpt element) Addselementto the list to be returned fromProperty.getGetterAnnotations().addGetterAnnotations(Excerpt... elements) Adds each element ofelementsto the list to be returned fromProperty.getGetterAnnotations().addPutAnnotations(Excerpt element) Addselementto the list to be returned fromProperty.getPutAnnotations().addPutAnnotations(Excerpt... elements) Adds each element ofelementsto the list to be returned fromProperty.getPutAnnotations().build()Returns a newly-createdPropertybased on the contents of thisBuilder.Returns a newly-created partialPropertyfor use in unit tests.clear()Resets the state of this builder.Clears the list to be returned fromProperty.getAccessorAnnotations().Sets the value to be returned byProperty.getBoxedType()toOptional.empty().Clears the list to be returned fromProperty.getGetterAnnotations().Clears the list to be returned fromProperty.getPutAnnotations().static Property.BuilderCreates a new builder usingvalueas a template.Returns an unmodifiable view of the list that will be returned byProperty.getAccessorAnnotations().Returns the value that will be returned byProperty.getAllCapsName().Returns the value that will be returned byProperty.getBoxedType().Returns the value that will be returned byProperty.getCapitalizedName().Returns an unmodifiable view of the list that will be returned byProperty.getGetterAnnotations().Returns the value that will be returned byProperty.getGetterName().getName()Returns the value that will be returned byProperty.getName().Returns an unmodifiable view of the list that will be returned byProperty.getPutAnnotations().getType()Returns the value that will be returned byProperty.getType().booleanReturns the value that will be returned byProperty.isFullyCheckedCast().booleanReturns the value that will be returned byProperty.isInEqualsAndHashCode().booleanReturns the value that will be returned byProperty.isInToString().booleanReturns the value that will be returned byProperty.isUsingBeanConvention().mapAllCapsName(UnaryOperator<String> mapper) Replaces the value to be returned byProperty.getAllCapsName()by applyingmapperto it and using the result.mapBoxedType(UnaryOperator<TypeMirror> mapper) If the value to be returned byProperty.getBoxedType()is present, replaces it by applyingmapperto it and using the result.mapCapitalizedName(UnaryOperator<String> mapper) Replaces the value to be returned byProperty.getCapitalizedName()by applyingmapperto it and using the result.mapFullyCheckedCast(UnaryOperator<Boolean> mapper) Replaces the value to be returned byProperty.isFullyCheckedCast()by applyingmapperto it and using the result.mapGetterName(UnaryOperator<String> mapper) Replaces the value to be returned byProperty.getGetterName()by applyingmapperto it and using the result.mapInEqualsAndHashCode(UnaryOperator<Boolean> mapper) Replaces the value to be returned byProperty.isInEqualsAndHashCode()by applyingmapperto it and using the result.mapInToString(UnaryOperator<Boolean> mapper) Replaces the value to be returned byProperty.isInToString()by applyingmapperto it and using the result.mapName(UnaryOperator<String> mapper) Replaces the value to be returned byProperty.getName()by applyingmapperto it and using the result.mapType(UnaryOperator<TypeMirror> mapper) Replaces the value to be returned byProperty.getType()by applyingmapperto it and using the result.mapUsingBeanConvention(UnaryOperator<Boolean> mapper) Replaces the value to be returned byProperty.isUsingBeanConvention()by applyingmapperto it and using the result.Copies values fromvalue, appending to collections, and skipping defaults and empty optionals.mergeFrom(Property.Builder template) Copies values fromtemplate, appending to collections, and skipping defaults, empty optionals and unset properties.mutateAccessorAnnotations(Consumer<? super List<Excerpt>> mutator) Appliesmutatorto the list to be returned fromProperty.getAccessorAnnotations().mutateGetterAnnotations(Consumer<? super List<Excerpt>> mutator) Appliesmutatorto the list to be returned fromProperty.getGetterAnnotations().mutatePutAnnotations(Consumer<? super List<Excerpt>> mutator) Appliesmutatorto the list to be returned fromProperty.getPutAnnotations().setAllCapsName(String allCapsName) Sets the value to be returned byProperty.getAllCapsName().setBoxedType(Optional<? extends TypeMirror> boxedType) Sets the value to be returned byProperty.getBoxedType().setBoxedType(TypeMirror boxedType) Sets the value to be returned byProperty.getBoxedType().setCapitalizedName(String capitalizedName) Sets the value to be returned byProperty.getCapitalizedName().setFullyCheckedCast(boolean fullyCheckedCast) Sets the value to be returned byProperty.isFullyCheckedCast().setGetterName(String getterName) Sets the value to be returned byProperty.getGetterName().setInEqualsAndHashCode(boolean inEqualsAndHashCode) Sets the value to be returned byProperty.isInEqualsAndHashCode().setInToString(boolean inToString) Sets the value to be returned byProperty.isInToString().Sets the value to be returned byProperty.getName().setNullableBoxedType(TypeMirror boxedType) Sets the value to be returned byProperty.getBoxedType().setType(TypeMirror type) Sets the value to be returned byProperty.getType().setUsingBeanConvention(boolean usingBeanConvention) Sets the value to be returned byProperty.isUsingBeanConvention().
-
Field Details
-
type
-
boxedType
-
name
-
capitalizedName
-
allCapsName
-
usingBeanConvention
private boolean usingBeanConvention -
inToString
private boolean inToString -
inEqualsAndHashCode
private boolean inEqualsAndHashCode -
getterName
-
fullyCheckedCast
private boolean fullyCheckedCast -
accessorAnnotations
-
getterAnnotations
-
putAnnotations
-
_unsetProperties
-
-
Constructor Details
-
Property_Builder
Property_Builder()
-
-
Method Details
-
from
Creates a new builder usingvalueas a template.If
valueis a partial, the builder will return more partials. -
setType
Sets the value to be returned byProperty.getType().- Returns:
- this
Builderobject - Throws:
NullPointerException- iftypeis null
-
mapType
Replaces the value to be returned byProperty.getType()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
getType
Returns the value that will be returned byProperty.getType().- Throws:
IllegalStateException- if the field has not been set
-
setBoxedType
Sets the value to be returned byProperty.getBoxedType().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifboxedTypeis null
-
setBoxedType
Sets the value to be returned byProperty.getBoxedType().- Returns:
- this
Builderobject
-
setNullableBoxedType
Sets the value to be returned byProperty.getBoxedType().- Returns:
- this
Builderobject
-
mapBoxedType
If the value to be returned byProperty.getBoxedType()is present, replaces it by applyingmapperto it and using the result.If the result is null, clears the value.
- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null
-
clearBoxedType
Sets the value to be returned byProperty.getBoxedType()toOptional.empty().- Returns:
- this
Builderobject
-
getBoxedType
Returns the value that will be returned byProperty.getBoxedType(). -
setName
Sets the value to be returned byProperty.getName().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifnameis null
-
mapName
Replaces the value to be returned byProperty.getName()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
getName
Returns the value that will be returned byProperty.getName().- Throws:
IllegalStateException- if the field has not been set
-
setCapitalizedName
Sets the value to be returned byProperty.getCapitalizedName().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifcapitalizedNameis null
-
mapCapitalizedName
Replaces the value to be returned byProperty.getCapitalizedName()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
getCapitalizedName
Returns the value that will be returned byProperty.getCapitalizedName().- Throws:
IllegalStateException- if the field has not been set
-
setAllCapsName
Sets the value to be returned byProperty.getAllCapsName().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifallCapsNameis null
-
mapAllCapsName
Replaces the value to be returned byProperty.getAllCapsName()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
getAllCapsName
Returns the value that will be returned byProperty.getAllCapsName().- Throws:
IllegalStateException- if the field has not been set
-
setUsingBeanConvention
Sets the value to be returned byProperty.isUsingBeanConvention().- Returns:
- this
Builderobject
-
mapUsingBeanConvention
Replaces the value to be returned byProperty.isUsingBeanConvention()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
isUsingBeanConvention
public boolean isUsingBeanConvention()Returns the value that will be returned byProperty.isUsingBeanConvention().- Throws:
IllegalStateException- if the field has not been set
-
setInToString
Sets the value to be returned byProperty.isInToString().- Returns:
- this
Builderobject
-
mapInToString
Replaces the value to be returned byProperty.isInToString()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns null
-
isInToString
public boolean isInToString()Returns the value that will be returned byProperty.isInToString(). -
setInEqualsAndHashCode
Sets the value to be returned byProperty.isInEqualsAndHashCode().- Returns:
- this
Builderobject
-
mapInEqualsAndHashCode
Replaces the value to be returned byProperty.isInEqualsAndHashCode()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns null
-
isInEqualsAndHashCode
public boolean isInEqualsAndHashCode()Returns the value that will be returned byProperty.isInEqualsAndHashCode(). -
setGetterName
Sets the value to be returned byProperty.getGetterName().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifgetterNameis null
-
mapGetterName
Replaces the value to be returned byProperty.getGetterName()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
getGetterName
Returns the value that will be returned byProperty.getGetterName().- Throws:
IllegalStateException- if the field has not been set
-
setFullyCheckedCast
Sets the value to be returned byProperty.isFullyCheckedCast().- Returns:
- this
Builderobject
-
mapFullyCheckedCast
Replaces the value to be returned byProperty.isFullyCheckedCast()by applyingmapperto it and using the result.- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmapperis null or returns nullIllegalStateException- if the field has not been set
-
isFullyCheckedCast
public boolean isFullyCheckedCast()Returns the value that will be returned byProperty.isFullyCheckedCast().- Throws:
IllegalStateException- if the field has not been set
-
addAccessorAnnotations
Addselementto the list to be returned fromProperty.getAccessorAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementis null
-
addAccessorAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getAccessorAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
addAllAccessorAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getAccessorAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
addAllAccessorAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getAccessorAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
addAllAccessorAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getAccessorAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
mutateAccessorAnnotations
Appliesmutatorto the list to be returned fromProperty.getAccessorAnnotations().This method mutates the list in-place.
mutatoris a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, likeCollection.stream().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmutatoris null
-
clearAccessorAnnotations
Clears the list to be returned fromProperty.getAccessorAnnotations().- Returns:
- this
Builderobject
-
getAccessorAnnotations
Returns an unmodifiable view of the list that will be returned byProperty.getAccessorAnnotations(). Changes to this builder will be reflected in the view. -
addGetterAnnotations
Addselementto the list to be returned fromProperty.getGetterAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementis null
-
addGetterAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getGetterAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
addAllGetterAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getGetterAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
addAllGetterAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getGetterAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
addAllGetterAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getGetterAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
mutateGetterAnnotations
Appliesmutatorto the list to be returned fromProperty.getGetterAnnotations().This method mutates the list in-place.
mutatoris a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, likeCollection.stream().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmutatoris null
-
clearGetterAnnotations
Clears the list to be returned fromProperty.getGetterAnnotations().- Returns:
- this
Builderobject
-
getGetterAnnotations
Returns an unmodifiable view of the list that will be returned byProperty.getGetterAnnotations(). Changes to this builder will be reflected in the view. -
addPutAnnotations
Addselementto the list to be returned fromProperty.getPutAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementis null
-
addPutAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getPutAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
addAllPutAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getPutAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
addAllPutAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getPutAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
addAllPutAnnotations
Adds each element ofelementsto the list to be returned fromProperty.getPutAnnotations().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifelementsis null or contains a null element
-
mutatePutAnnotations
Appliesmutatorto the list to be returned fromProperty.getPutAnnotations().This method mutates the list in-place.
mutatoris a void consumer, so any value returned from a lambda will be ignored. Take care not to call pure functions, likeCollection.stream().- Returns:
- this
Builderobject - Throws:
NullPointerException- ifmutatoris null
-
clearPutAnnotations
Clears the list to be returned fromProperty.getPutAnnotations().- Returns:
- this
Builderobject
-
getPutAnnotations
Returns an unmodifiable view of the list that will be returned byProperty.getPutAnnotations(). Changes to this builder will be reflected in the view. -
mergeFrom
Copies values fromvalue, appending to collections, and skipping defaults and empty optionals.- Returns:
- this
Builderobject
-
mergeFrom
Copies values fromtemplate, appending to collections, and skipping defaults, empty optionals and unset properties.- Returns:
- this
Builderobject
-
clear
Resets the state of this builder.- Returns:
- this
Builderobject
-
build
Returns a newly-createdPropertybased on the contents of thisBuilder.- Throws:
IllegalStateException- if any field has not been set
-
buildPartial
Returns a newly-created partialPropertyfor use in unit tests. State checking will not be performed. Unset properties will throw anUnsupportedOperationExceptionwhen accessed via the partial object.The builder returned by
from(org.inferred.freebuilder.processor.property.Property)will propagate the partial status of its input, overridingbuild()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.
-