Interface ITriState

All Known Implementing Classes:
ETriState

public interface ITriState
Base interface for the tri state.
Author:
Philip Helger
  • Method Summary

    Modifier and Type
    Method
    Description
    Convert the tri state value into a Boolean value, depending on what "undefined" means.
    default Boolean
    getAsBooleanObj(boolean bUndefinedValue)
    Convert the tri state value into a Boolean value, depending on what "undefined" means.
    getAsBooleanObj(Boolean aUndefinedValue)
    Convert the tri state value into a Boolean value, depending on what "undefined" means.
    boolean
    Convert the tri state value into a boolean value.
    boolean
    getAsBooleanValue(boolean bUndefinedValue)
    Convert the tri state value into a boolean value, depending on what "undefined" means.
    boolean
     
    boolean
     
    boolean
     
    default boolean
     
  • Method Details

    • isTrue

      boolean isTrue()
      Returns:
      true if the value is true.
    • isFalse

      boolean isFalse()
      Returns:
      true if the value is false
    • isDefined

      boolean isDefined()
      Returns:
      true if the value is not undefined (if it is either true or false)
    • isUndefined

      default boolean isUndefined()
      Returns:
      true if the value is undefined (if it is neither true nor false)
    • getAsBooleanValue

      boolean getAsBooleanValue()
      Convert the tri state value into a boolean value. If it is undefined, an IllegalStateException is thrown.
      Returns:
      true if isTrue() is true, false if isFalse() is true, or an exception otherwise!
      Throws:
      IllegalStateException - If this is undefined
      See Also:
    • getAsBooleanValue

      boolean getAsBooleanValue(boolean bUndefinedValue)
      Convert the tri state value into a boolean value, depending on what "undefined" means.
      Parameters:
      bUndefinedValue - The boolean representation of undefined.
      Returns:
      true if isTrue() is true, false if isFalse() is true, or otherwise the passed parameter!
      See Also:
    • getAsBooleanObj

      @Nullable Boolean getAsBooleanObj()
      Convert the tri state value into a Boolean value, depending on what "undefined" means.
      Returns:
      Boolean.TRUE if isTrue() is true, Boolean.FALSE if isFalse() is true, or null!
    • getAsBooleanObj

      @Nonnull default Boolean getAsBooleanObj(boolean bUndefinedValue)
      Convert the tri state value into a Boolean value, depending on what "undefined" means.
      Parameters:
      bUndefinedValue - The
      invalid reference
      boolean
      representation of undefined.
      Returns:
      Boolean.TRUE if isTrue() is true, Boolean.FALSE if isFalse() is true, or otherwise the passed parameter!
    • getAsBooleanObj

      @Nullable Boolean getAsBooleanObj(@Nullable Boolean aUndefinedValue)
      Convert the tri state value into a Boolean value, depending on what "undefined" means.
      Parameters:
      aUndefinedValue - The Boolean representation of undefined.
      Returns:
      Boolean.TRUE if isTrue() is true, Boolean.FALSE if isFalse() is true, or otherwise the passed parameter!