Example usage for org.apache.commons.lang3 CharUtils toIntValue

List of usage examples for org.apache.commons.lang3 CharUtils toIntValue

Introduction

In this page you can find the example usage for org.apache.commons.lang3 CharUtils toIntValue.

Prototype

public static int toIntValue(final Character ch) 

Source Link

Document

Converts the character to the Integer it represents, throwing an exception if the character is not numeric.

This method coverts the char '1' to the int 1 and so on.

 CharUtils.toIntValue('3')  = 3 CharUtils.toIntValue(null) throws IllegalArgumentException CharUtils.toIntValue('A')  throws IllegalArgumentException 

Usage

From source file:se.inera.ifv.insuranceprocess.healthreporting.util.ModelConverter.java

public static boolean isSamordningsNummer(String personNr) {
    char dateDigit = personNr.charAt(SAMORDNING_MONTH_INDEX);
    return (CharUtils.toIntValue(dateDigit) >= SAMORDNING_MONTH_VALUE_MIN);
}