Class Property.Builder<T,V>
java.lang.Object
org.apache.juneau.commons.reflect.Property.Builder<T,V>
- Type Parameters:
T- The object type.V- The value type.
Builder for constructing
Property instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the property instance.Sets both getter and setter from aFieldInfo.getter(ThrowingFunction<T, V> producer) Sets the producer (getter) using a function.getter(MethodInfo method) Sets the producer (getter) from aMethodInfo.setter(ThrowingConsumer2<T, V> consumer) Sets the consumer (setter) using a throwing consumer.setter(MethodInfo method) Sets the consumer (setter) from aMethodInfo.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
getter
Sets the producer (getter) using a function.- Parameters:
producer- The producer function. Can benull .- Returns:
- This object.
-
setter
Sets the consumer (setter) using a throwing consumer.- Parameters:
consumer- The consumer function. Can benull .- Returns:
- This object.
-
field
Sets both getter and setter from aFieldInfo.This is a convenience method that creates both producer and consumer from a field.
- Parameters:
field- The field info. Must not benull .- Returns:
- This object.
-
getter
Sets the producer (getter) from aMethodInfo.The method should take no parameters and return the property value.
- Parameters:
method- The method info. Must not benull .- Returns:
- This object.
-
setter
Sets the consumer (setter) from aMethodInfo.The method should take one parameter (the value to set) and return void.
- Parameters:
method- The method info. Must not benull .- Returns:
- This object.
-
build
Builds the property instance.- Returns:
- A new property instance.
-