- Type Parameters:
V
- The type of the value to be used.
- All Known Subinterfaces:
ValueAccessor.ValueProperty<V>
public interface ValueAccessor<V>
Provides access to a value property for e.g. key/value-pair.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
ValueAccessor.ValueBuilder<V,
B extends ValueAccessor.ValueBuilder<V, B>> Provides a builder method for a the property returning the builder for applying multiple build operations.static interface
Extends theValueAccessor
with a setter method.static interface
Extends theValueAccessor
with a setter method. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()
Retrieves the value from the value property.default V
getValueOr
(V aValue) Retrieves the value from the value property.
-
Method Details
-
getValue
V getValue()Retrieves the value from the value property.- Returns:
- The value stored by the value property.
-
getValueOr
Retrieves the value from the value property. If there is no value for the property, then the provided value is returned. Depending on the implementation, not present might meannull
or empty as well (being "" for aString
).- Parameters:
aValue
- In case the value to be retrieved is null, then the given value is returned.- Returns:
- The value stored by the value property or the given value if the stored value is null.
-