List of utility methods to do Char Create
char | toChar(String parameter) to Char if (parameter.length() != 1) throw new Exception("Invalid value for a char " + parameter); return parameter.charAt(0); |
char[] | toChar(String string) Converts a string to a char array (null safe). if (string == null) { return null; return string.toCharArray(); |
char | toChar(String string) to Char return (char) toInt(string); |
char | toChar(String unicode) to Char return (char) Integer.parseInt(unicode, 16); |
char[] | toCharA(byte[] data) to Char A if (data == null || data.length % 2 != 0) return null; char[] chrs = new char[data.length / 2]; for (int i = 0; i < chrs.length; i++) { chrs[i] = toChar(new byte[] { data[(i * 2)], data[(i * 2) + 1], }); return chrs; |
Character | toCharacter(final String value) create Chracter from str. return value.charAt(0);
|
char | toCharacter(final String value) to Character return value.charAt(0);
|
Character | toCharacter(Object o) to Character if (o == null) return null; if (o.getClass() == Character.class) return (Character) o; if (o.getClass() == Boolean.class) return booleanToChar((Boolean) o); if (o.getClass() == Byte.class) return (char) ((Byte) o).byteValue(); ... |
Character | toCharacter(Object o) to Character String string = toString(o);
return string == null ? null : string.isEmpty() ? null : string.charAt(0);
|
char | toCharacter(Object obj) to Character return toCharacter(obj, (char) ' '); |