Example usage for java.lang Character.UnicodeBlock equals

List of usage examples for java.lang Character.UnicodeBlock equals

Introduction

In this page you can find the example usage for java.lang Character.UnicodeBlock equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Compares this object against the specified object.

Usage

From source file:com.turo.pushy.apns.util.ApnsPayloadBuilderBenchmark.java

@Setup
public void setUp() {
    this.apnsPayloadBuilder = new ApnsPayloadBuilder();

    final char[] messageBodyCharacters;
    {//ww  w . j  av a 2  s.c o  m
        final Character.UnicodeBlock unicodeBlock = Character.UnicodeBlock.forName(this.unicodeBlockName);
        final List<Character> charactersInBlock = new ArrayList<>();

        for (int codePoint = Character.MIN_CODE_POINT; codePoint < Character.MAX_CODE_POINT; codePoint++) {
            if (unicodeBlock.equals(Character.UnicodeBlock.of(codePoint))
                    && !Character.isISOControl(codePoint)) {
                charactersInBlock.add((char) codePoint);
            }
        }

        messageBodyCharacters = new char[charactersInBlock.size()];

        for (int i = 0; i < charactersInBlock.size(); i++) {
            messageBodyCharacters[i] = charactersInBlock.get(i);
        }
    }

    this.messageBody = RandomStringUtils.random(this.messageBodyLength, messageBodyCharacters);
}