org.eobjects.metamodel.util
Class BooleanComparator

java.lang.Object
  extended by org.eobjects.metamodel.util.BooleanComparator
All Implemented Interfaces:
Comparator<Object>

public final class BooleanComparator
extends Object
implements Comparator<Object>

Comparator of booleans

Author:
Kasper Sørensen

Method Summary
 int compare(Object o1, Object o2)
           
static Comparable<Object> getComparable(Object object)
           
static Comparator<Object> getComparator()
           
static boolean isBoolean(Object o)
           
static boolean parseBoolean(String string)
          Parses a string and returns a boolean representation of it.
static Boolean toBoolean(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Method Detail

getComparator

public static Comparator<Object> getComparator()

getComparable

public static Comparable<Object> getComparable(Object object)

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator<Object>

toBoolean

public static Boolean toBoolean(Object o)

parseBoolean

public static boolean parseBoolean(String string)
                            throws IllegalArgumentException
Parses a string and returns a boolean representation of it. To parse the string the following values will be accepted, irrespective of case.

Parameters:
string - the string to parse
Returns:
a boolean
Throws:
IllegalArgumentException - if the string provided is null or cannot be parsed as a boolean

isBoolean

public static boolean isBoolean(Object o)


Copyright © 2007-2013. All Rights Reserved.