Example usage for org.apache.commons.text CharacterPredicate CharacterPredicate

List of usage examples for org.apache.commons.text CharacterPredicate CharacterPredicate

Introduction

In this page you can find the example usage for org.apache.commons.text CharacterPredicate CharacterPredicate.

Prototype

CharacterPredicate

Source Link

Usage

From source file:ch.cyberduck.core.AlphanumericRandomStringService.java

@Override
public String random() {
    return new RandomStringGenerator.Builder().withinRange('0', 'z').filteredBy(new CharacterPredicate() {
        @Override/*from ww w .j av a  2 s .  co m*/
        public boolean test(final int codePoint) {
            return Character.isAlphabetic(codePoint) || Character.isDigit(codePoint);
        }
    }).build().generate(8);
}