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.syncope.core.persistence.dao.TaskExecTest.java

@Test
public void findLatestStarted() {
    PropagationTask task = taskDAO.find(1L);
    assertNotNull(task);/*w  w  w .jav  a2s . c om*/

    TaskExec latestStarted = taskExecDAO.findLatestStarted(task);
    assertNotNull(latestStarted);
    assertEquals(Long.valueOf(1L), latestStarted.getId());
}

From source file:org.homiefund.web.controllers.TransactionController.java

@PostMapping("/purchase/")
public String submitPurchase(@ModelAttribute PurchaseForm purchaseForm) {
    log.info(purchaseForm);//from ww w. java2  s.com
    TransactionDTO transactionDTO = new TransactionDTO();
    transactionDTO.setDescription(purchaseForm.getDescription());
    TransactionTypeDTO tt = new TransactionTypeDTO();
    tt.setId(Long.valueOf(1L));
    transactionDTO.setTransactionType(tt);
    transactionDTO.setAmount(purchaseForm.getAmount());
    transactionDTO
            .setParticipants(purchaseForm.getParticipants().stream().filter(p -> p != null && p.getInclude()) //null check just in case
                    .map(p -> mapper.map(p, TransactionParticipantDTO.class)).collect(Collectors.toList()));
    transactionDTO.setRevoked(false);

    transactionService.create(transactionDTO);

    return "redirect:/auth/";
}

From source file:com.springsource.insight.plugin.apache.http.hc4.HttpPlaceholderRequestTest.java

@Test
public void testOnNoRequestValue() {
    assertSame(HttpPlaceholderRequest.PLACEHOLDER,
            HttpPlaceholderRequest.resolveHttpRequest("hello", Long.valueOf(System.nanoTime())));
}

From source file:org.nekorp.workflow.desktop.servicio.bridge.ClienteBridge.java

@Override
public void unload(ClienteVB origen, Cliente destino) {
    BeanUtils.copyProperties(origen, destino,
            new String[] { "id", "domicilio", "telefonoUno", "telefonoDos", "telefonoTres" });
    if (StringUtils.isEmpty(origen.getId())) {
        destino.setId(null);//from w w w .j a  v a2  s .c  o  m
    } else {
        destino.setId(Long.valueOf(origen.getId()));
    }
    domicilioBridge.unload(origen.getDomicilio(), destino.getDomicilio());
    telefonoBridge.unload(origen.getTelefonoUno(), destino.getTelefonoContacto().get(0));
    telefonoBridge.unload(origen.getTelefonoDos(), destino.getTelefonoContacto().get(1));
    telefonoBridge.unload(origen.getTelefonoTres(), destino.getTelefonoContacto().get(2));
}

From source file:com.codebutler.farebot.card.Card.java

public static Card fromXml(String xml) throws Exception {
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document doc = builder.parse(new InputSource(new StringReader(xml)));

    Element rootElement = doc.getDocumentElement();

    CardType type = CardType.class.getEnumConstants()[Integer.parseInt(rootElement.getAttribute("type"))];
    byte[] id = Utils.hexStringToByteArray(rootElement.getAttribute("id"));
    Date scannedAt = rootElement.hasAttribute("scanned_at")
            ? new Date(Long.valueOf(rootElement.getAttribute("scanned_at")))
            : new Date(0);
    switch (type) {
    case MifareDesfire:
        return DesfireCard.fromXml(id, scannedAt, rootElement);
    case CEPAS://  www  .j av a 2 s.  c o m
        return CEPASCard.fromXML(id, scannedAt, rootElement);
    case FeliCa:
        return FelicaCard.fromXml(id, scannedAt, rootElement);
    case MifareClassic:
        return ClassicCard.fromXml(id, scannedAt, rootElement);
    default:
        throw new UnsupportedOperationException("Unsupported card type: " + type);
    }
}

From source file:com.insoul.ti.controller.FinanceController.java

@RequestMapping("/list")
public ModelAndView list(@Valid ProjectListRequest request, BindingResult result) {
    ModelAndView mv = createModelView(FINANCE_LIST, request);
    PageQuery query = request.init().getQuery();
    FinancingCriteria criteria = new FinancingCriteria();
    criteria.setLimit(query.getPage_size());
    criteria.setOffset(Long.valueOf(query.getIndex()).intValue());
    criteria.setStatus(new String[] { request.getStatus() });
    criteria.setProjectName(request.getName());
    criteria.setUserId(request.getId());
    criteria.setBeused((byte) 2);
    List<Financing> list = financingDAO.queryFinancing(criteria);
    Long count = financingDAO.countFinancing(criteria);
    query.setCount((count == null || count <= 0L) ? 0 : count.intValue());
    mv.addObject("query", query);
    mv.addObject("financingList", list);
    mv.addObject("success", CollectionUtils.isNotEmpty(list));
    mv.addObject("req", request);
    return mv;// w w  w  .  j a v  a  2 s  .c o m
}

From source file:com.datos.vfs.provider.http.HttpRandomAccessContent.java

@Override
public void seek(final long pos) throws IOException {
    if (pos == filePointer) {
        // no change
        return;//from w  ww.ja v  a2  s  .  c  o m
    }

    if (pos < 0) {
        throw new FileSystemException("vfs.provider/random-access-invalid-position.error", Long.valueOf(pos));
    }
    if (dis != null) {
        close();
    }

    filePointer = pos;
}

From source file:ru.codemine.pos.dao.ProductDAOImplTest.java

@Test
@Transactional/*  w  w w. j ava2 s  .c  o m*/
public void testProductDao() {
    Product product = new Product("art001-test", "NewTestProduct", "123", 200.50);

    productDAO.create(product);

    Product p1 = productDAO.getByArtikul("art001-test");
    Assert.assertNotNull(p1);
    Assert.assertEquals("NewTestProduct", p1.getName());
    Assert.assertTrue(p1.getPrice().equals(200.50));

    p1.setBarcode("123456");
    productDAO.update(p1);

    Product p2 = productDAO.getById(Long.valueOf(1));
    Assert.assertNotNull(p2);

    Product p3 = productDAO.getByBarcode("123456");
    Assert.assertNotNull(p3);
    Assert.assertTrue(p3.getPrice().equals(200.50));

    List<Product> plist = productDAO.getAll();
    Assert.assertNotNull(plist);
    Assert.assertTrue(plist.size() > 0);

}

From source file:com.ewcms.web.pubsub.PubsubServlet.java

private void initDelay() {
    String value = this.getInitParameter(DELAY_PARAM_NAME);
    if (StringUtils.isNumeric(value)) {
        delay = Long.valueOf(value);
    }//from  w  w  w .j a  v  a  2s.  c  om
}

From source file:com.clustercontrol.selfcheck.monitor.WebServiceQueueMonitor.java

/**
 * ???//ww w.j  a v  a2  s. c  o m
 * @return ????
 */
@Override
public void execute() {
    if (!HinemosPropertyUtil.getHinemosPropertyBool("selfcheck.monitoring.ws.queue", true)) {
        m_log.debug("skip");
        return;
    }

    /**  */
    int queueSize = 0;
    boolean warn = true;

    threshold = HinemosPropertyUtil
            .getHinemosPropertyNum("selfcheck.monitoring.ws.queue.threshold", Long.valueOf(10000)).intValue();

    /** ? */
    queueSize = WebServiceCorePlugin.getQueueSize();
    if (queueSize <= threshold) {
        m_log.debug("web service queue is normal. (queueSize = " + queueSize + ")");
        warn = false;
    }

    if (warn) {
        m_log.info("web service queue is too large. (queueSize = " + queueSize + ")");
    }
    if (!isNotify(subKey, warn)) {
        return;
    }
    String[] msgAttr1 = { Integer.toString(queueSize), Integer.toString(threshold) };
    AplLogger.put(PriorityConstant.TYPE_WARNING, PLUGIN_ID, MessageConstant.MESSAGE_SYS_008_SYS_SFC, msgAttr1,
            "too many request to Hinemos Manager (tcp:8080). (queued request " + queueSize + " > threshold "
                    + threshold + ")");

    return;
}