Interface LogProperty.Property<T>
- 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 LogProperty
LogProperty.AbstractKeysBuilder<B>, LogProperty.Property<T>, LogProperty.PropertyConvertException, LogProperty.PropertyFunction<T,R, E>, 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 Modifier and TypeInterfaceDescriptionstatic classBuilds property keys.static interfaceA property description that can retrieve a property result by being passedLogProperties.static final classThrown if an error happens while converting a property.static interfaceLogProperty.PropertyFunction<T extends @Nullable Object, R extends @Nullable Object, E extends Exception>An error friendlyFunctionfor converting properties.static interfaceExtracts and converts fromLogPropertiesand is also an immutable builder forLogProperty.Propertys.static final classBuilds aLogProperty.Property(or aLogProviderviaLogProperty.PropertyKeyBuilder.provider(LogProperty.PropertyFunction)) that is looked up under one or more keys tried in order: if the value is not found under the first key added, the next key added is tried, and so on.static final classThrow if property is missing.static interfaceParent interface for property exceptions.static interfaceProperty helper mixin.static interfaceA supplier of a property result.static interfaceA result that is not missing and will either be an error or success.static interfaceThe result of a property fetched from properties.static final classThrown byLogProperty.Validator.validate()when one or more of the accumulatedLogProperty.Results failed, reporting every failure in a single message instead of just the first one encountered.static classAccumulatesLogProperty.Results from one or more property lookups and validates them together, so that a caller resolving several properties in sequence can report every failure at once instead of failing fast on the first bad property. -
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
-
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
-
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.
-