Example usage for java.lang Long valueOf

List of usage examples for java.lang Long valueOf

Introduction

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

Prototype

@HotSpotIntrinsicCandidate
public static Long valueOf(long l) 

Source Link

Document

Returns a Long instance representing the specified long value.

Usage

From source file:org.fornax.cartridges.sculptor.smartclient.serviceimpl.PropertySupportFacade.java

public Long getPropertyAsLong(String propKey) {
    Long retVal = null;/*from w w w .  ja va 2s  .  c  o  m*/
    try {
        retVal = Long.valueOf(getProperty(propKey, null));
    } catch (Throwable th) {
        log.warn("Error geting property '{}' as Long", propKey);
    }
    return retVal;
}

From source file:cz.muni.fi.mir.db.service.impl.ElementServiceImpl.java

@Override
@Transactional(readOnly = true)/*from   w  w w.j a  v  a2  s.  c  o  m*/
public Element getElementByID(Long id) throws IllegalArgumentException {
    if (id == null || Long.valueOf("0").compareTo(id) >= 0) {
        throw new IllegalArgumentException(
                "Given id is out of valid range. Should be grater than one but was [" + id + "]");
    }
    return elementDAO.getByID(id);
}

From source file:com.amalto.core.save.generator.InMemoryAutoIncrementGenerator.java

@Override
public synchronized String generateId(String dataClusterName, String conceptName, String keyElementName) {
    long nextId = 0;
    String key = dataClusterName + "."
            + AutoIncrementGenerator.getConceptForAutoIncrement(dataClusterName, conceptName) + "."
            + keyElementName;/*from w  ww. ja v  a 2 s  .  co  m*/
    String value = CONFIGURATION.getProperty(key);
    if (value != null) {
        nextId = Long.valueOf(value);
    }
    nextId++;
    if (!DataRecord.ValidateRecord.get()) {// don't actually save if for Record Validation
        CONFIGURATION.setProperty(key, String.valueOf(nextId));
        NEED_TO_SAVE.set(true);
    }
    return String.valueOf(nextId);
}

From source file:net.indialend.attendance.controller.BranchController.java

@RequestMapping("/delete")
public ModelAndView deleteBranch(String branchId) {
    ModelAndView view = new ModelAndView(new RedirectView("list"));

    if (branchId != null) {
        String[] bids = branchId.split(",");
        for (String bid : bids) {
            branchService.deleteBranch(Long.valueOf(bid));
        }/*from  w  ww.  j a va 2 s .c  om*/

    }
    return view;
}

From source file:com.inmobi.messaging.publisher.AuditCounterAccumulator.java

void incrementReceived(Long timestamp) {
    Long window = getWindow(timestamp);
    if (!counters.received.containsKey(window)) {
        counters.received.put(window, Long.valueOf(0));
    }//from  w w w.  j  a  v a 2s.  c  o  m
    counters.received.put(window, counters.received.get(window) + 1);
}

From source file:com.thoughtworks.go.domain.JobStateTransition.java

public int hashCode() {
    int result = Long.valueOf(jobId).hashCode();
    result = 31 * result + (currentState != null ? currentState.hashCode() : 0);
    result = 31 * result + (stateChangeTime != null ? stateChangeTime.hashCode() : 0);
    result = 31 * result + (int) (jobId ^ (jobId >>> 32));
    return result;
}

From source file:org.homiefund.test.dao.TransactionTypeDAOTest.java

@Test
public void getById() {
    Assert.assertEquals(Long.valueOf(2L), transactionTypeDAO.getById(2L).getId());
}

From source file:es.pode.administracion.presentacion.repositoriosExternos.verRepositoriosExternos.VerNodoSQIControllerImpl.java

public void cargaNodoSQI(ActionMapping mapping, CargaNodoSQIForm form, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    try {/* w w  w.j av  a2s.co  m*/

        Long id = Long.valueOf(request.getParameter("id"));
        Long[] ids = new Long[1];
        ids[0] = id;
        NodoSQIVO[] nodos = this.getSrvGestionSqiService().consultaNodosSQI(ids);
        NodoSQIVO nodo = nodos[0];

        form.setClave(nodo.getClave());
        form.setDescripcionNodo(nodo.getDescripcionNodo());
        form.setGestorSesion(nodo.getGestorSesion());
        form.setId(id);
        form.setIdentificadorSesion(nodo.getIdentificadorSesion());
        form.setLenguajeConsulta(nodo.getLenguajeConsulta());
        form.setLenguajeRespuesta(nodo.getLenguajeRespuesta());
        form.setNombreNodo(nodo.getNombreNodo());
        form.setUrlServicio(nodo.getUrlServicio());
        form.setUsuario(nodo.getUsuario());

    } catch (Exception e) {
        logger.error("Error: " + e);
        throw new ValidatorException("{errors.vernodoSQI}");
    }

}

From source file:org.asqatasun.entity.dao.audit.ContentDAOImplTest.java

public void testFindOrphanContentList() {
    WebResource wr = webresourceDAO.read(Long.valueOf(1));
    assertEquals(Long.valueOf(2), contentDAO.findNumberOfOrphanContentFromWebResource(wr));
    List<Content> contentList = contentDAO.findOrphanContentList(wr, 0, 100);
    assertEquals(2, contentList.size());
    assertEquals(Long.valueOf(3), contentDAO.findNumberOfOrphanRelatedContentFromWebResource(wr));
    contentList = contentDAO.findOrphanRelatedContentList(wr, 0, 10);
    assertEquals(3, contentList.size());
    wr = webresourceDAO.read(Long.valueOf(2));
    contentList = contentDAO.findOrphanContentList(wr, 0, 10);
    assertEquals(1, contentList.size());
    contentList = contentDAO.findOrphanRelatedContentList(wr, 0, 10);
    assertEquals(1, contentList.size());
}

From source file:com.pursuer.reader.easyrss.data.parser.ItemIdJSONParser.java

public void parse() throws JsonParseException, IOException {
    ItemId itemId = new ItemId();
    int level = 0;
    while (parser.nextToken() != null) {
        final String name = parser.getCurrentName();
        switch (parser.getCurrentToken()) {
        case START_OBJECT:
        case START_ARRAY:
            level++;//  w  w  w . j  a v a  2s  .  c om
            break;
        case END_OBJECT:
        case END_ARRAY:
            level--;
            break;
        case VALUE_STRING:
            if (level == 3) {
                if ("id".equals(name)) {
                    itemId.setUid(Long.toHexString(Long.valueOf(parser.getText())));
                } else if ("timestampUsec".equals(name)) {
                    itemId.setTimestamp(Long.valueOf(parser.getText()));
                }
            }
            break;
        default:
            break;
        }
        if (level == 2) {
            if (itemId.getUid() != null && listener != null) {
                listener.onItemIdRetrieved(itemId);
            }
            itemId = new ItemId();
        }
    }
    parser.close();
}