Example usage for org.apache.commons.lang3.math NumberUtils INTEGER_ZERO

List of usage examples for org.apache.commons.lang3.math NumberUtils INTEGER_ZERO

Introduction

In this page you can find the example usage for org.apache.commons.lang3.math NumberUtils INTEGER_ZERO.

Prototype

Integer INTEGER_ZERO

To view the source code for org.apache.commons.lang3.math NumberUtils INTEGER_ZERO.

Click Source Link

Document

Reusable Integer constant for zero.

Usage

From source file:eu.jsan.duvi.commons.conversion.bool.BooleanToIntegerConverter.java

@Override
public Integer convertToDatabaseColumn(Boolean attribute) {
    return (attribute != null && attribute) ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO;
}

From source file:com.oz.digital.sign.window.MainView.java

private void menItemExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menItemExitActionPerformed
    System.exit(NumberUtils.INTEGER_ZERO);
}

From source file:com.tao_harmony.fx2extend.journal.Journal.java

/**
 * ??.??????????.//  ww  w  . j  a  v  a2s.c  om
 * <ul>
 * <li></li>
 * <li>?</li>
 * <li>?????</li>
 * </ul>
 */
public void reset() {
    this.ammount = NumberUtils.LONG_ZERO;
    this.checkNumber = StringUtils.EMPTY;
    this.creditCode = NumberUtils.SHORT_ZERO;
    this.creditSubCode = StringUtils.EMPTY;
    this.customer = StringUtils.EMPTY;
    this.customerCode = NumberUtils.INTEGER_ZERO;
    this.debitCode = NumberUtils.SHORT_ZERO;
    this.debitSubCode = StringUtils.EMPTY;
    this.departmentAmmountClass = NumberUtils.BYTE_ZERO;
    this.departmentCode = NumberUtils.SHORT_ZERO;
    this.departmentCount = NumberUtils.BYTE_ZERO;
    this.evidenceNumber = StringUtils.EMPTY;
    this.fundBalanceMajor = NumberUtils.BYTE_ZERO;
    this.fundBalanceMinor = NumberUtils.BYTE_ZERO;
    this.paymentDay = NumberUtils.INTEGER_ZERO;
    this.purchaseDayBegins = NumberUtils.INTEGER_ZERO;
    this.purchaseDayEnds = NumberUtils.INTEGER_ZERO;
    this.purchasePattern = NumberUtils.BYTE_ZERO;
    this.recordNumber = NumberUtils.INTEGER_ZERO;
    this.recoveryDay = NumberUtils.INTEGER_ZERO;
    this.ruleNumber = NumberUtils.INTEGER_ZERO;
    this.segmentCode = NumberUtils.BYTE_ZERO;
    this.slipNumber = NumberUtils.INTEGER_ZERO;
    this.summary = StringUtils.EMPTY;
    this.taxAmmount = NumberUtils.LONG_ZERO;
    this.taxClass = NumberUtils.BYTE_ZERO;
    this.taxInputClass = NumberUtils.BYTE_ZERO;
    this.taxRate = NumberUtils.INTEGER_ZERO;
}

From source file:org.amanzi.awe.scripting.AbstractScriptingPluginTests.java

@Test
public void testGetScriptsForProjectifExist() throws IOException {
    String projectName = TEST1_MODULE_NAME.split(SCRIPT_ID_SEPARATOR)[NumberUtils.INTEGER_ZERO];
    File requiredModule = null;//from  w w  w  .j  a va 2  s.c  o m
    for (File module : modules) {
        if (module.getName().equals(projectName)) {
            requiredModule = module;
        }
    }
    Assert.assertEquals("Not expected count of files ",
            TestActivator.getDefault().getScriptsForProject(projectName).size(),
            requiredModule.listFiles().length);

}

From source file:org.amanzi.neo.services.impl.statistics.PropertyStatisticsService.java

protected void updatePropertyVault(final Node propertyVault, final PropertyVault vault)
        throws ServiceException {
    nodeService.updateProperty(propertyVault, statisticsNodeProperties.getClassProperty(),
            vault.getClassName());//from  www.  j a  va  2 s. c  o  m

    int size = nodeService.getNodeProperty(propertyVault, getGeneralNodeProperties().getSizeProperty(),
            NumberUtils.INTEGER_ZERO, false);

    Map<Object, Integer> values = new HashMap<Object, Integer>(vault.getValuesMap());

    Queue<Integer> removedIndexes = new LinkedList<Integer>();
    Stack<Integer> processedIndex = new Stack<Integer>();

    if (size > 0) {
        for (int i = 0; i < size; i++) {
            Object property = nodeService.getNodeProperty(propertyVault,
                    statisticsNodeProperties.getValuePrefix() + i, null, true);

            Integer newCount = values.remove(property);
            if (newCount != null) {
                nodeService.updateProperty(propertyVault, statisticsNodeProperties.getCountPrefix() + i,
                        newCount);
            } else {
                removedIndexes.add(i);
            }
            processedIndex.add(i);
        }
    }

    // remove old values
    for (Integer index : removedIndexes) {
        nodeService.removeNodeProperty(propertyVault, statisticsNodeProperties.getValuePrefix() + index, false);
        nodeService.removeNodeProperty(propertyVault, statisticsNodeProperties.getCountPrefix() + index, false);
    }

    int counter = size;
    for (Entry<Object, Integer> statEntry : values.entrySet()) {
        counter = removedIndexes.isEmpty() ? counter : removedIndexes.remove();

        nodeService.updateProperty(propertyVault, statisticsNodeProperties.getValuePrefix() + counter,
                statEntry.getKey());
        nodeService.updateProperty(propertyVault, statisticsNodeProperties.getCountPrefix() + counter,
                statEntry.getValue());

        counter++;
    }

    for (Integer newIndex : removedIndexes) {
        int oldIndex = processedIndex.pop();
        nodeService.renameNodeProperty(propertyVault, statisticsNodeProperties.getValuePrefix() + oldIndex,
                statisticsNodeProperties.getValuePrefix() + newIndex, false);
        nodeService.renameNodeProperty(propertyVault, statisticsNodeProperties.getCountPrefix() + oldIndex,
                statisticsNodeProperties.getCountPrefix() + newIndex, false);
    }

    nodeService.updateProperty(propertyVault, getGeneralNodeProperties().getSizeProperty(), values.size());
    nodeService.updateProperty(propertyVault, statisticsNodeProperties.getDefaultValueProperty(),
            vault.getDefaultValue());
}

From source file:org.amanzi.neo.services.impl.statistics.PropertyStatisticsServiceTest.java

@Test
public void testCheckServiceActivityOnUpdatingPropertyVaultWithValues() throws Exception {
    Integer[] counts = DEFAULT_COUNTS_FOR_VALUES;

    Node propertyVaultNode = initializeMockedPropertyVaultNode(0, counts);

    service.updatePropertyVault(propertyVaultNode, propertyVault);

    verify(nodeService).getNodeProperty(propertyVaultNode, GENERAL_NODE_PROPERTIES.getSizeProperty(),
            NumberUtils.INTEGER_ZERO, false);

    verify(nodeService).updateProperty(propertyVaultNode,
            PROPERTY_STATISTICS_NODE_PROPERTIES.getClassProperty(), "some class");

    for (int i = 0; i < counts.length; i++) {
        verify(nodeService).updateProperty(eq(propertyVaultNode),
                eq(PROPERTY_STATISTICS_NODE_PROPERTIES.getValuePrefix() + i), contains(PROPERTY_NAME));

        verify(nodeService).updateProperty(eq(propertyVaultNode),
                eq(PROPERTY_STATISTICS_NODE_PROPERTIES.getCountPrefix() + i), any(Integer.class));
    }//from   w  w w .j a v a2  s . c  o m
}