Example usage for java.lang Long Long

List of usage examples for java.lang Long Long

Introduction

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

Prototype

@Deprecated(since = "9")
public Long(String s) throws NumberFormatException 

Source Link

Document

Constructs a newly allocated Long object that represents the long value indicated by the String parameter.

Usage

From source file:com.springsource.html5expense.mongodb.services.DataInitalizer.java

@PostConstruct
private void init() {

    mongoTemplate.getCollection("ExpenseType").drop();
    mongoTemplate.getCollection("Expense").drop();
    DBCollection expenseTypeCollection = mongoTemplate.getCollection("ExpenseType");

    BasicDBObject expenseTypeDoc = new BasicDBObject();

    expenseTypeDoc.put("_id", new Long(1));
    expenseTypeDoc.put("expenseTypeId", new Long(1));
    expenseTypeDoc.put("name", "GYM");
    expenseTypeCollection.insert(expenseTypeDoc);

    expenseTypeDoc.clear();/*w w w . j a v a  2 s  . co m*/
    expenseTypeDoc.put("_id", new Long(2));
    expenseTypeDoc.put("expenseTypeId", new Long(2));
    expenseTypeDoc.put("name", "TELEPHONE");
    expenseTypeCollection.insert(expenseTypeDoc);

    expenseTypeDoc.clear();
    expenseTypeDoc.put("_id", new Long(3));
    expenseTypeDoc.put("expenseTypeId", new Long(3));
    expenseTypeDoc.put("name", "MEDICARE");
    expenseTypeCollection.insert(expenseTypeDoc);

    expenseTypeDoc.clear();
    expenseTypeDoc.put("_id", new Long(4));
    expenseTypeDoc.put("expenseTypeId", new Long(4));
    expenseTypeDoc.put("name", "TRAVEL");
    expenseTypeCollection.insert(expenseTypeDoc);
}

From source file:caillou.company.clonemanager.gui.handler.AfterStatisticsComputedHandler.java

@Override
public void handle(WorkerStateEvent event) {
    StatisticAnalyse statisticAnalyse = (StatisticAnalyse) event.getSource().getValue();
    StatisticsModel searchStatisticsModel = mainModel.getSearchStatisticsModel();
    TaskModel.TASK currentTask = mainModel.getTaskModel().getCurrentTask();
    searchStatisticsModel.setNbScannedFiles(statisticAnalyse.getNbFileScanned());
    switch (currentTask) {
    case DETECT_DOUBLONS:
        if (searchStatisticsModel.getInitialSpaceWasted().equals(new Long(-1))) {
            searchStatisticsModel.setInitialSpaceWasted(statisticAnalyse.getWastedSpace());
        }/*from   w w w .j a  v a2s.co  m*/
        searchStatisticsModel.setNbDuplicateFiles(statisticAnalyse.getNumberOfDuplicateFiles());
        searchStatisticsModel.setSpaceWasted(statisticAnalyse.getWastedSpace());
        break;
    case DETECT_MISSING:
        searchStatisticsModel.setSpaceToDuplicate(statisticAnalyse.getSpaceToDuplicate());
        searchStatisticsModel.setNbFileToDuplicate(statisticAnalyse.getNbFileToDuplicate());
        break;
    }
}

From source file:org.schors.tempmail.TempMailOptions.java

public TempMailOptions() {
    this.checkPeriod = new Long(30000);
}

From source file:com.centurylink.mdw.listener.ExternalNotifyWaitingActivityEventHandler.java

public String handleEventMessage(String message, Object msgdoc, Map<String, String> metainfo)
        throws EventHandlerException {
    String response;//from  w w  w. jav a 2s .  co  m
    try {
        String eventName = metainfo.get(Listener.METAINFO_EVENT_NAME);
        String eventMessage = metainfo.get(Listener.METAINFO_EVENT_MESSAGE);
        Long eventInstId = new Long(metainfo.get(Listener.METAINFO_DOCUMENT_ID));
        eventName = placeHolderTranslation(eventName, metainfo, (XmlObject) msgdoc);
        eventMessage = StringEscapeUtils
                .unescapeXml(placeHolderTranslation(eventMessage, metainfo, (XmlObject) msgdoc));
        int delay = 2;
        String av = PropertyManager.getProperty(PropertyNames.ACTIVITY_RESUME_DELAY);
        if (av != null) {
            try {
                delay = Integer.parseInt(av);
                if (delay < 0)
                    delay = 0;
                else if (delay > 300)
                    delay = 300;
            } catch (Exception e) {
                logger.warn("activity resume delay spec is not an integer");
            }
        }
        // a custom implementation of this handler may populate parameters here
        Integer status = notifyProcesses(eventName, eventInstId, eventMessage, delay);

        response = createResponseMessage(null, "NOTIFICATION STATUS CODE " + status, msgdoc, metainfo);

    } catch (Exception e) {
        response = createResponseMessage(e, null, msgdoc, metainfo);
    }
    return response;
}

From source file:es.caib.sgtsic.utils.faces.DataModel.java

public DataModel(Class<E> entityClass, AbstractServiceInterface<E> service) {
    this.allItems = new ArrayList<>();
    this.filteredItems = new ArrayList<>();
    this.current = null;
    this.id = new Long(0);
    this.entityClass = entityClass;
    this.service = service;

    /*//from   w  w  w .  jav a 2 s. c o m
            
    this.editadoOk = false;
    this.current = null;
    this.lista = new ArrayList<>();
    this.listas = new HashMap<>();
    this.listasDetalle = new HashMap<>();
    this.currentDetalle = null;
    this.idsListas = new HashMap<>();
    this.confirmMsg = new HashMap<>();
    //this.borrable = false;
    populateLista();
    //populateListas();
            
            
    */

}

From source file:com.imaginary.home.controller.ScheduledCommandList.java

@Override
public int compareTo(ScheduledCommandList scheduledCommand) {
    if (scheduledCommand == null) {
        return -1;
    }/*from w w  w. ja va2 s . c  om*/
    if (scheduledCommand == this) {
        return 0;
    }
    int x = (new Long(executeAfter)).compareTo(scheduledCommand.executeAfter);

    if (x == 0) {
        x = scheduleId.compareTo(scheduledCommand.scheduleId);
    }
    return x;
}

From source file:com.collabnet.ccf.core.ShutDownCCF.java

public static void exitCCF(int exitCode) {
    synchronized (log) {
        if (alreadyExited) {
            log.debug("CCF shutdown already in progress ...");
        } else {// w  w w  . j a  v a2  s . co m
            alreadyExited = true;
            // After 10 seconds, we will kill the VM even if shutdown hooks are still in process
            new ShutDownCCF(exitCode, new Long(10000)).start();
            new ShutDownCCF(exitCode).start();
        }
    }
}

From source file:fr.mael.microrss.dao.ArticleDaoTest.java

@Test
public void testNbArticles() {
    Feed feed = new Feed();
    feed.setId(1);// w  ww  .  j a v  a 2  s  .com
    Assert.assertEquals(new Long(8), articleDao.nbArticlesForFeed(feed));
    feed.setId(2);
    Assert.assertEquals(new Long(12), articleDao.nbArticlesForFeed(feed));
    feed.setId(3);
    Assert.assertEquals(new Long(0), articleDao.nbArticlesForFeed(feed));
}

From source file:com.healthcit.cacure.model.TableQuestionTest.java

@Test
@DataSet("classpath:skips_on_tables.xml")
public void testGetSkipAffectees_single() {
    TableQuestion tquest = em.find(TableQuestion.class, 1014L);
    Set<BaseSkipPatternDetail> skipAffectees = tquest.getSkipAffectees();
    assertNotNull(skipAffectees);//  w  w  w.  ja  v a  2s .  co m
    assertEquals(1, skipAffectees.size());
    BaseSkipPatternDetail detail = skipAffectees.toArray(new BaseSkipPatternDetail[0])[0];
    assertEquals(new Long(1050), detail.getId());
    assertEquals(new Long(1050), detail.getSkip().getId());
    assertEquals(new Long(1031), detail.getFormElementId());
    assertNull(detail.getFormId());
    assertEquals(new Long(1008), detail.getSkipTriggerForm().getId());
    assertEquals(new Long(1014), detail.getSkipTriggerQuestion().getId());
}

From source file:com.cemeterylistingswebtest.test.rest.PublishedListingController.java

@Test(enabled = false)
public void testCreate() {
    Long subID = new Long(17);
    List<PersonOtherNames> names = null;

    PublishedDeceasedListing newListing = new PublishedDeceasedListing.Builder().setFirstName("Hendrika")
            .setSurname("Fourie").setMaidenName("Gerber").setGender("Female").setDateOfBirth("08/06/1969")
            .setDateOfDeath("14/02/2005").setGraveInscription("Hippiest person eva").setGraveNumber("2456")
            .setImageOfBurialSite("/images/001.jpg").setLastKnownContactName("Berry")
            .setLastKnownContactNumber("0725576482").setSubscriberSubmitID(subID).setNames(names).build();

    HttpEntity<PublishedDeceasedListing> requestEntity = new HttpEntity<>(newListing, getContentType());
    //        Make the HTTP POST request, marshaling the request to JSON, and the response to a String
    ResponseEntity<String> responseEntity = restTemplate.exchange(URL + "api/publishedListings/create",
            HttpMethod.POST, requestEntity, String.class);
    System.out.println(" THE RESPONSE BODY " + responseEntity.getBody());
    System.out.println(" THE RESPONSE STATUS CODE " + responseEntity.getStatusCode());
    System.out.println(" THE RESPONSE IS HEADERS " + responseEntity.getHeaders());

    Assert.assertEquals(responseEntity.getStatusCode(), HttpStatus.OK);
    id = newListing.getPublishedListingID();
}