Class YesOrNo

java.lang.Object
ch.autumo.commons.configuration.YesOrNo
All Implemented Interfaces:
Comparable<YesOrNo>

public class YesOrNo extends Object implements Comparable<YesOrNo>
YesOrNo; another Boolean using the string values 'yes' or 'no'.
  • Field Details

    • YES

      public static final YesOrNo YES
      The YesOrNo object corresponding to the primitive value true.
    • NO

      public static final YesOrNo NO
      The YesOrNo object corresponding to the primitive value false.
  • Constructor Details

    • YesOrNo

      public YesOrNo(boolean value)
      Yes or No?
      Parameters:
      value - value
  • Method Details

    • parseBoolean

      public static boolean parseBoolean(String s)
      Parse boolean.
      Parameters:
      s - string
      Returns:
      true if 'yes/Yes'
    • booleanValue

      public boolean booleanValue()
      Get boolean value.
      Returns:
      boolean value
    • valueOf

      public static YesOrNo valueOf(String s)
      Value of string.
      Parameters:
      s - string 'yes' or 'no'
      Returns:
      yes or no object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(YesOrNo o)
      Specified by:
      compareTo in interface Comparable<YesOrNo>
    • compare

      public static int compare(boolean a, boolean b)
      Compare values.
      Parameters:
      a - value 1
      b - value 2
      Returns:
      compare value
    • toString

      public static String toString(boolean b)
      To string.
      Parameters:
      b - boolean value
      Returns:
      string representation