Example usage for com.liferay.portal.kernel.util PropsKeys COUNTER_INCREMENT_PREFIX

List of usage examples for com.liferay.portal.kernel.util PropsKeys COUNTER_INCREMENT_PREFIX

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PropsKeys COUNTER_INCREMENT_PREFIX.

Prototype

String COUNTER_INCREMENT_PREFIX

To view the source code for com.liferay.portal.kernel.util PropsKeys COUNTER_INCREMENT_PREFIX.

Click Source Link

Usage

From source file:com.liferay.counter.service.persistence.CounterFinderImpl.java

License:Open Source License

protected int getRangeSize(String name) {
    if (name.equals(_NAME)) {
        return PropsValues.COUNTER_INCREMENT;
    }//ww w.jav  a2  s  .  c o m

    String incrementType = null;

    int pos = name.indexOf(CharPool.POUND);

    if (pos != -1) {
        incrementType = name.substring(0, pos);
    } else {
        incrementType = name;
    }

    Integer rangeSize = _rangeSizeMap.get(incrementType);

    if (rangeSize == null) {
        rangeSize = GetterUtil.getInteger(PropsUtil.get(PropsKeys.COUNTER_INCREMENT_PREFIX + incrementType),
                PropsValues.COUNTER_INCREMENT);

        _rangeSizeMap.put(incrementType, rangeSize);
    }

    return rangeSize.intValue();
}