Interface ReadableValue<V>

Type Parameters:
V - type of the value.
All Superinterfaces:
Supplier<V>
All Known Subinterfaces:
PropertyPath<V>, ReadableTypedValue<V>, TypedPropertyPath<V>, WritableValue<V>

public interface ReadableValue<V> extends Supplier<V>
This interface gives read access to the value of an object.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
     
    static <T> T
    get(ReadableValue<T> value)
    Null-safe access to get().
     
  • Method Details

    • get

      V get()
      Specified by:
      get in interface Supplier<V>
      Returns:
      the current value of this object. May be null unless otherwise stated.
    • getSafe

      V getSafe()
      Returns:
      the same as get() but trying to avoid returning null where possible. So a neutral element is returned instead of null for each type supporting this (e.g. "" for String, 0 for any kind of Number, Boolean.FALSE, empty collection, etc.).
    • get

      static <T> T get(ReadableValue<T> value)
      Null-safe access to get().
      Type Parameters:
      T - type of the value
      Parameters:
      value - the ReadableValue to unwrap.
      Returns:
      the value of the ReadableValue. Will be null if the given ReadableValue is null or its value is null.