Example usage for org.apache.commons.lang3 BooleanUtils toInteger

List of usage examples for org.apache.commons.lang3 BooleanUtils toInteger

Introduction

In this page you can find the example usage for org.apache.commons.lang3 BooleanUtils toInteger.

Prototype

public static int toInteger(final boolean bool, final int trueValue, final int falseValue) 

Source Link

Document

Converts a boolean to an int specifying the conversion values.

 BooleanUtils.toInteger(true, 1, 0)  = 1 BooleanUtils.toInteger(false, 1, 0) = 0 

Usage

From source file:org.jasig.cas.ticket.registry.EhCacheTicketRegistry.java

/**
 * {@inheritDoc}/*  w  w w.  j  a  v a2 s .  com*/
 * @see Cache#getKeysWithExpiryCheck()
 */
@Override
public int sessionCount() {
    return BooleanUtils.toInteger(this.supportRegistryState,
            this.ticketGrantingTicketsCache.getKeysWithExpiryCheck().size(), super.sessionCount());
}

From source file:org.jasig.cas.ticket.registry.EhCacheTicketRegistry.java

/**
 * {@inheritDoc}//from  ww w  .  j ava  2s  . com
 * @see Cache#getKeysWithExpiryCheck()
 */
@Override
public int serviceTicketCount() {
    return BooleanUtils.toInteger(this.supportRegistryState,
            this.serviceTicketsCache.getKeysWithExpiryCheck().size(), super.serviceTicketCount());
}