List of utility methods to do Boolean Convert to
String | booleanArrayToString(boolean[] b, String delim) boolean Array To String StringBuffer sb = new StringBuffer(); for (int i = 0; i < b.length; i++) { if (sb.length() > 0) { sb.append(delim); sb.append(b[i] ? "T" : "F"); return sb.toString(); ... |
String | booleanArrayToString(boolean[] ba) Utility to convert a boolean[] to a String. if (ba == null) { return "null"; StringBuilder sb = new StringBuilder("["); for (int i = 0; i < ba.length; ++i) { sb.append(ba[i] ? 'Y' : 'N'); sb.append(']'); ... |
T | booleanToBasicType(boolean b, Class boolean To Basic Type if (clazz.equals(Boolean.class)) return (T) Boolean.valueOf(b); if (clazz.equals(Byte.class)) return (T) Byte.valueOf(booleanToByte(b)); if (clazz.equals(Character.class)) return (T) Character.valueOf(booleanToChar(b)); if (clazz.equals(Short.class)) return (T) Short.valueOf(booleanToShort(b)); ... |
double | booleanToDouble(boolean b) boolean To Double return b ? 1. : 0.;
|
String | booleanToStr(boolean bool) boolean To Str if (bool) { return "Yes"; } else { return "No"; |
int | booleanToTinyInt(boolean b) MySQL boolean to tinyint. if (b) { return (1); } else { return (0); |
String | booleanToYesNo(Boolean b) Returns "Y" for true and "N" for false return b.booleanValue() ? "Y" : "N"; |
int | boolToNum(Boolean bool) Converts a Boolean value to int value int num = 0; if (bool.booleanValue()) { num = 1; return num; |
String | BoolToNum(boolean bool) Bool To Num return bool ? "1" : "0"; |
byte | boolToNumber(boolean aBoolean) Converts a boolean to a number, according to the lobby protocol standard. return (aBoolean ? ((byte) 1) : ((byte) 0)); |