org.eobjects.metamodel.util
Class BooleanComparator
java.lang.Object
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
- true
- false
- 1
- 0
- yes
- no
- y
- n
- 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.