Java Utililty Methods Char Create

List of utility methods to do Char Create

Description

The list of methods to do Char Create are organized into topic(s).

Method

chartoChar(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();
chartoChar(String string)
to Char
return (char) toInt(string);
chartoChar(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;
CharactertoCharacter(final String value)
create Chracter from str.
return value.charAt(0);
chartoCharacter(final String value)
to Character
return value.charAt(0);
CharactertoCharacter(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();
...
CharactertoCharacter(Object o)
to Character
String string = toString(o);
return string == null ? null : string.isEmpty() ? null : string.charAt(0);
chartoCharacter(Object obj)
to Character
return toCharacter(obj, (char) ' ');