Код: Выделить всё
static {
final String hexCharacters = "0123456789ABCDEFabcdef"; //NON-NLS
final Set tempHexSet = new HashSet();
for (char c : hexCharacters.toCharArray()) {
tempHexSet.add(c);
}
final Set hexSet = Collections.unmodifiableSet(tempHexSet);
}
Код: Выделить всё
private static final Set hexSet
= Collections.unmodifiableSet(new HashSet("0123456789ABCDEFabcdef".toCharArray()));
Код: Выделить всё
private static final Set hexSet = Collections.unmodifiableSet(
new HashSet("0123456789ABCDEFabcdef".chars().boxed().collect(Collectors.toList())
);
Подробнее здесь: https://stackoverflow.com/questions/798 ... rs-in-java
Мобильная версия