Interface LogProperty.Property<T>

Type Parameters:
T - property type.
All Superinterfaces:
LogProperty
Enclosing interface:
LogProperty

public static sealed interface LogProperty.Property<T> extends 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:
  • 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

      void set(T value, BiConsumer<String,T> consumer)
      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

      default T require(@Nullable T value)
      Programmatically check if a value that corresponds to this property is not null.
      Parameters:
      value - maybe null but 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.