- Type Parameters:
T- property type.
- All Superinterfaces:
LogProperty
- Enclosing interface:
LogProperty
A property description that can retrieve a property result by being passed
LogProperties. The property instance does not actually contain the
value of the property!.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jstach.rainbowgum.LogProperty
LogProperty.AbstractKeysBuilder<B>, LogProperty.Property<T>, LogProperty.PropertyConvertException, LogProperty.PropertyFunction<T extends @Nullable Object,R extends @Nullable Object, E extends Exception>, LogProperty.PropertyGetter<T>, LogProperty.PropertyKeyBuilder<T>, LogProperty.PropertyMissingException, LogProperty.PropertyProblem, LogProperty.PropertySupport, LogProperty.PropertyValue<T>, LogProperty.RequiredResult<T>, LogProperty.Result<T>, LogProperty.ValidationException, LogProperty.Validator -
Method Summary
Modifier and TypeMethodDescriptiondefault LogProperty.PropertyValue<T> bind(LogProperties properties) Creates a lazy result from the properties.builder()Builder.get(LogProperties properties) Gets a property value as a result.key()Gets the first key.<U> LogProperty.Property<U> map(LogProperty.PropertyFunction<? super T, ? extends U, ? super Exception> mapper) Maps the property to another value type.propertyString(T value) Converts the value into a String that can be parsed by the built-in properties parsing of types.default TProgrammatically check if a value that corresponds to this property is not null.voidset(T value, BiConsumer<String, T> consumer) Set a property if its not null.
-
Method Details
-
key
Gets the first key.- Returns:
- key.
-
get
Gets a property value as a result.- Parameters:
properties- key values.- Returns:
- result.
-
map
<U> LogProperty.Property<U> map(LogProperty.PropertyFunction<? super T, ? extends U, ? super Exception> mapper) Maps the property to another value type.- Type Parameters:
U- value type.- Parameters:
mapper- function to map.- Returns:
- property.
-
propertyString
Converts the value into a String that can be parsed by the built-in properties parsing of types. Supported types: String, Boolean, Integer, URI, Map, List.- Parameters:
value- to be converted to string.- Returns:
- property representation of value.
-
set
Set a property if its not null.- Parameters:
value- value to set.consumer- first parameter is first key and second parameter is non null value.
-
require
Programmatically check if a value that corresponds to this property is not null.- Parameters:
value- maybenullbut an exception will be thrown if it is.- Returns:
- value if not null.
- Throws:
NoSuchElementException- if the value is null.- API Note
- this is an expected exception and should not be treated as crash-able exception that should avoided with static analysis such as Checker Framework and is why the input argument is nullable.
-
builder
Builder.- Returns:
- builder.
-
bind
Creates a lazy result from the properties.- Parameters:
properties- properties used to retrieve a value when the supplier is called.- Returns:
- lazy supplier of result of property based on passed in properties.
-