Interface EitherHolder<T>


public interface EitherHolder<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if this holder is backed by a direct value.
    boolean
    Returns true if this holder has a resource key.
    Returns the value of this holder.
    key()
    Returns the resource key.
    static <T> EitherHolder<T>
    of(Holder<T> value)
    Returns a direct or indirect value holder.
    static <T> EitherHolder<T>
    of(String key)
    Returns an indirect holder via the resource key.
  • Method Details

    • of

      static <T> EitherHolder<T> of(Holder<T> value)
      Returns a direct or indirect value holder.
      Type Parameters:
      T - the type of the value
      Parameters:
      value - the value
      Returns:
      a new direct holder
    • of

      static <T> EitherHolder<T> of(String key)
      Returns an indirect holder via the resource key.
      Type Parameters:
      T - the type of the value
      Parameters:
      key - the resource key
      Returns:
      a new holder with the given resource key
    • hasHolder

      boolean hasHolder()
      Returns true if this holder is backed by a direct value.
      Returns:
      true if the holder is direct
      See Also:
    • hasKey

      boolean hasKey()
      Returns true if this holder has a resource key.
      Returns:
      true if this holder has a resource key
      See Also:
    • holder

      Holder<T> holder()
      Returns the value of this holder.
      Returns:
      the value of this holder
      Throws:
      IllegalArgumentException - if this contains a resource key instead of a holder
      See Also:
    • key

      String key()
      Returns the resource key.
      Returns:
      the resource key
      Throws:
      IllegalArgumentException - if this contains a holder instead of a resource key
      See Also: