Example usage for java.lang Long longValue

List of usage examples for java.lang Long longValue

Introduction

In this page you can find the example usage for java.lang Long longValue.

Prototype

@HotSpotIntrinsicCandidate
public long longValue() 

Source Link

Document

Returns the value of this Long as a long value.

Usage

From source file:com.netpace.aims.controller.application.WapApplicationHelper.java

public static Long getFilteredApplicationStatus(Long aimsLifecyclePhaseId, String currUserType) {
    if (currUserType.equals(AimsConstants.ALLIANCE_USERTYPE)) {
        if ((aimsLifecyclePhaseId.longValue() == AimsConstants.PHASE_INITIAL_APPROVAL_ID.longValue())
                || (aimsLifecyclePhaseId.longValue() == AimsConstants.PHASE_BUSINESS_APPROVAL_GRANTED_ID
                        .longValue())/*from   w  w  w .  ja  v a 2s.  c  o m*/
                || (aimsLifecyclePhaseId.longValue() == AimsConstants.PHASE_PENDING_DCR_ID.longValue())
                || (aimsLifecyclePhaseId.longValue() == AimsConstants.PHASE_PENDING_ARM_ID.longValue()))
            return AimsConstants.SUBMISSION_ID;
        else if ((aimsLifecyclePhaseId.longValue() == AimsConstants.PHASE_TESTING_PASSED_ID.longValue())
                || (aimsLifecyclePhaseId.longValue() == AimsConstants.PHASE_TESTING_FAILED_ID.longValue())
                || (aimsLifecyclePhaseId.longValue() == AimsConstants.PHASE_PUBLICATION_READY_ID.longValue()))
            return AimsConstants.PHASE_SUBMITTED_DCR_ID;
        else
            return aimsLifecyclePhaseId;
    } else {
        return aimsLifecyclePhaseId;
    }
}

From source file:be.solidx.hot.test.TestScriptExecutors.java

@Test
public void testGroovyExecutor1() throws Exception {
    Script<CompiledScript> script = new Script<CompiledScript>(
            IOUtils.toByteArray(getClass().getResourceAsStream("/groovy-script.groovy")),
            "test_" + Thread.currentThread().getName());
    Collection<Long> results = multiThreadedTest(script, 1000000, groovyScriptExecutor);
    for (Object result : results) {
        Long r = (Long) result;
        System.out.println(result);
        Assert.assertEquals(1000000, r.longValue());
    }/* w w  w.  j a  va2s  . co  m*/
}

From source file:com.mauersu.util.redis.DefaultZSetOperations.java

public Long rank(K key, Object o) {
    final byte[] rawKey = rawKey(key);
    final byte[] rawValue = rawValue(o);

    return execute(new RedisCallback<Long>() {

        public Long doInRedis(RedisConnection connection) {
            connection.select(dbIndex);//from  w w  w.j av  a 2 s  . c  o m
            Long zRank = connection.zRank(rawKey, rawValue);
            return (zRank != null && zRank.longValue() >= 0 ? zRank : null);
        }
    }, true);
}

From source file:com.android.vending.licensing.i.java

private void c(String paramString) {
    try {//  w w w  . j  av  a 2  s .co m
        Long localLong2 = Long.valueOf(Long.parseLong(paramString));
        localLong1 = localLong2;
        this.o = localLong1.longValue();
        this.s.a("maxRetries", paramString);
        return;
    } catch (NumberFormatException localNumberFormatException) {
        while (true) {
            Log.w("ServerManagedPolicy", "Licence retry count (GR) missing, grace period disabled");
            paramString = "0";
            Long localLong1 = Long.valueOf(0L);
        }
    }
}

From source file:com.mauersu.util.redis.DefaultZSetOperations.java

public Long reverseRank(K key, Object o) {
    final byte[] rawKey = rawKey(key);
    final byte[] rawValue = rawValue(o);

    return execute(new RedisCallback<Long>() {

        public Long doInRedis(RedisConnection connection) {
            connection.select(dbIndex);//w ww.  j  a va  2s  . c o  m
            Long zRank = connection.zRevRank(rawKey, rawValue);
            return (zRank != null && zRank.longValue() >= 0 ? zRank : null);
        }
    }, true);
}

From source file:com.android.vending.licensing.i.java

private void b(String paramString) {
    try {/*from ww w .  jav  a2 s  . c  om*/
        Long localLong2 = Long.valueOf(Long.parseLong(paramString));
        localLong1 = localLong2;
        this.n = localLong1.longValue();
        this.s.a("retryUntil", paramString);
        return;
    } catch (NumberFormatException localNumberFormatException) {
        while (true) {
            Log.w("ServerManagedPolicy", "License retry timestamp (GT) missing, grace period disabled");
            paramString = "0";
            Long localLong1 = Long.valueOf(0L);
        }
    }
}

From source file:mil.dod.th.ose.junit4xmltestrunner.ant.XMLJUnitResultFormatter.java

/**
 * Interface TestListener.//from   w ww . j  a  v  a2 s.  c  o  m
 *
 * <p>A Test is finished.
 * @param test the test.
 */
public void endTest(final Description test) {
    // Fix for bug #5637 - if a junit.extensions.TestSetup is
    // used and throws an exception during setUp then startTest
    // would never have been called
    if (!m_TestStarts.containsKey(test)) {
        startTest(test);
    }

    Element currentTest = null;
    if (!m_FailedTests.containsKey(test)) {
        currentTest = m_Doc.createElement(TESTCASE);
        final String name = test.getMethodName();
        currentTest.setAttribute(ATTR_NAME, name == null ? UNKNOWN : name);
        // a TestSuite can contain Tests from multiple classes,
        // even tests with the same name - disambiguate them.
        currentTest.setAttribute(ATTR_CLASSNAME, test.getClassName());
        m_RootElement.appendChild(currentTest);
        m_TestElements.put(test, currentTest);
    } else {
        currentTest = m_TestElements.get(test);
    }

    final Long l = m_TestStarts.get(test);
    currentTest.setAttribute(ATTR_TIME, "" + ((System.currentTimeMillis() - l.longValue()) / ONE_SECOND));

    Logging.log(LogService.LOG_INFO,
            "%n######################%n### COMPLETED TEST ### %s%n######################",
            test.getMethodName());
}

From source file:com.baidu.stqa.signet.web.service.impl.NodeServiceImpl.java

@Override
public Long saveNodePosition(Long nodeId, Long parentId) {
    // ??/*from w ww .j ava 2s .c om*/
    // parentIdchild node
    List<Node> childNodes = nodeMapper.selectByParentId(parentId);
    // sequpdate
    Long seq = 0L;
    for (Node node : childNodes) {
        if (node.getSeq().longValue() > seq.longValue()) {
            seq = node.getSeq();
        }
    }
    Node node = new Node();
    node.setSeq(seq + 1L);
    node.setNodeId(nodeId);
    node.setParentId(parentId);
    nodeMapper.update(node);
    return nodeId;
}

From source file:com.daro.persistence.generic.dao.GenericDaoImpl.java

/**
 * Remove entity with id passed.// w w w  .j a  v a 2 s  .  c om
 * 
 * @param id Entity identifier
 * @throws PersistenceException
 */
@Override
@SuppressWarnings("unchecked")
public void removeById(Long id) throws PersistenceException {
    Session session = this.getCurrentSession();
    T t = (T) session.load(clazz, id.longValue());
    if (null != t) {
        session.delete(t);
        if (loggerInfoEnabled)
            logger.debug("Persistence layer info: " + clazz.getSimpleName() + " deleted successfully,  details="
                    + t);
    } else {
        if (loggerInfoEnabled)
            logger.debug("Persistence layer info: " + clazz.getSimpleName()
                    + " can not be deleted because is null!");
    }
}

From source file:annis.gui.resultview.SingleResultPanel.java

private void calculateHelperVariables() {
    markedExactMap = new HashMap<String, String>();
    markedCoveredMap = new HashMap<String, String>();

    if (result != null) {
        SDocumentGraph g = result.getSDocumentGraph();
        if (g != null) {
            for (SNode n : result.getSDocumentGraph().getSNodes()) {

                SFeature featMatched = n.getSFeature(ANNIS_NS, FEAT_MATCHEDNODE);
                Long match = featMatched == null ? null : featMatched.getSValueSNUMERIC();

                if (match != null) {
                    int color = Math.max(0,
                            Math.min((int) match.longValue() - 1, MatchedNodeColors.values().length - 1));
                    SFeature feat = n.getSFeature(ANNIS_NS, FEAT_INTERNALID);
                    if (feat != null) {
                        markedExactMap.put("" + feat.getSValueSNUMERIC(),
                                MatchedNodeColors.values()[color].name());
                    }//from  w  w  w .  jav a  2  s .  c  o m
                }

            }
        } // end if g not null
    } // end if result not null
}