Package org.refcodes.mixin
Interface ValueAccessor<V>
-
- 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
Nested Classes Modifier and Type Interface Description static 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
ValueAccessor.ValueMutator<V>
Extends theValueAccessor
with a setter method.static interface
ValueAccessor.ValueProperty<V>
Extends theValueAccessor
with a setter method.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description V
getValue()
Retrieves the value from the value property.default V
getValueOr(V aValue)
Retrieves the value from the value property.
-
-
-
Method Detail
-
getValue
V getValue()
Retrieves the value from the value property.- Returns:
- The value stored by the value property.
-
getValueOr
default V getValueOr(V aValue)
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- Returns:
- The value stored by the value property.
-
-