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.thinkbiganalytics.jobrepo.query.model.transform.JobStatusTransform.java

/**
 * Enusre that the list contains a date matching Now - the Period.  if not add it to the collection
 *///from  w w  w  .  j  ava 2 s .  c  o  m
public static void ensureDateFromPeriodExists(List<JobStatusCount> jobStatusCounts, Period period) {

    //add in the very first date relative to the period if it doesnt exist with a count of 0
    if (jobStatusCounts != null && !jobStatusCounts.isEmpty()) {
        //get the first min date in the result set
        Date firstDateInResultSet = jobStatusCounts.stream().map(jobStatusCount -> jobStatusCount.getDate())
                .min(Date::compareTo).get();

        Date firstDate = DateUtils.truncate(DateTimeUtil.getNowUTCTime().minus(period).toDate(), Calendar.DATE);
        boolean containsFirstDate = jobStatusCounts.stream()
                .anyMatch(jobStatusCount -> jobStatusCount.getDate().equals(firstDate));
        if (!containsFirstDate) {
            JobStatusCount first = jobStatusCounts.get(0);
            JobStatusCount min = new JobStatusCountResult(first);
            min.setDate(firstDate);
            min.setCount(new Long(0));
            jobStatusCounts.add(min);
        }
    }

}

From source file:com.redhat.rhn.frontend.action.errata.CreateSetupAction.java

/**
 * {@inheritDoc}/* w  ww . j a  v  a2 s.  c o  m*/
 */
public ActionForward execute(ActionMapping mapping, ActionForm formIn, HttpServletRequest request,
        HttpServletResponse response) {
    DynaActionForm form = (DynaActionForm) formIn;

    if (StringUtils.isBlank(form.getString("advisoryRelease"))) {
        //set advisory release field to 1
        form.set("advisoryRelease", LocalizationService.getInstance().formatNumber(new Long(1)));
    }

    //set advisoryTypes list for select drop down
    request.setAttribute("advisoryTypes", ErrataManager.advisoryTypes());

    //set l10n-ed advisoryTypeLabels list for select drop down
    form.set("advisoryTypeLabels", ErrataManager.advisoryTypeLabels());

    return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
}

From source file:com.thoughtworks.xstream.io.json.JsonWriterModeTest.java

public JsonWriterModeTest(String name, int xstreamMode, int writerMode, JsonWriter.Format format) {
    super(name);/*from  w ww.j av a2 s  .c om*/
    this.mode = writerMode;
    this.format = format;

    X x = new X(42);
    x.aStr = "Codehaus";
    x.innerObj = new Y();
    x.innerObj.yField = "Y";

    target = new ArrayList(Arrays.asList(new Object[] { new Object[][] { new Object[0] }, null, new Integer(42),
            new Long(Long.MAX_VALUE), new Y(), x.innerObj, new ArrayList(),
            new CharSequence[] { "JUnit", "XStream", new StringBuffer("JSON"), new StringBuffer("JScript") },
            x, }));

    xstream = new XStream();
    xstream.setMode(xstreamMode);
    xstream.alias("X", X.class);
    xstream.alias("Y", Y.class);
    xstream.alias("CharSequence", CharSequence.class);
}

From source file:com.googlecode.psiprobe.controllers.system.MemoryStatsController.java

protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
        throws Exception {
    return new ModelAndView(getViewName()).addObject("pools", getJvmMemoryInfoAccessorBean().getPools())
            .addObject("collectionPeriod", new Long(getCollectionPeriod()));
}

From source file:org.openmeetings.test.domain.TestAddGroup.java

@Test
public void testAddingGroup() {

    long organisation_id = organisationmanagement.addOrganisation("default", 1);

    log.error("new organisation: " + organisation_id);

    long organisation_usersid = organisationmanagement.addUserToOrganisation(new Long(1), organisation_id,
            new Long(1));

    log.error("new organisation_user: " + organisation_usersid);

    Users us = usersDao.getUser(new Long(1));

    log.error(us.getLastname());//from   w  w  w. j  a  va2s  .  c o  m
    log.error(us.getAdresses().getTown());

    /*
     * for (Iterator it = us.getAdresses().getEmails().iterator();
     * it.hasNext();){ Adresses_Emails addrMails = (Adresses_Emails)
     * it.next(); log.error(addrMails.getMail().getEmail()); }
     * log.error("size of domains: "+us.getOrganisation_users().size()); for
     * (Iterator it2 = us.getOrganisation_users().iterator();
     * it2.hasNext();){ Organisation_Users orgUsers = (Organisation_Users)
     * it2.next(); log.error(orgUsers.getOrganisation().getName()); }
     */
}

From source file:com.anite.zebra.ext.state.memory.MemoryTaskInstance.java

/**
 * /*from   ww w .  j ava2 s.c  o m*/
 */
public MemoryTaskInstance() {
    long temp = taskInstanceCounter.longValue();
    taskInstanceId = new Long(temp);
    temp++;
    taskInstanceCounter = new Long(temp);
    log.info("Created MemoryTaskInstance id " + taskInstanceId);
}

From source file:com.muni.fi.pa165.survive.rest.client.utils.DtoBuilder.java

public static AreaDto getAreaDto(CommandLine line) {
    AreaDto dto = new AreaDto();
    if (line.hasOption("n")) {
        dto.setName(line.getOptionValue("n"));
    }/*from w ww  .  j a va 2s .c  o m*/
    if (line.hasOption("d")) {
        dto.setDescription(line.getOptionValue("d"));
    }
    if (line.hasOption("q")) {
        dto.setTerrain(TerrainType.valueOf(line.getOptionValue("q").toUpperCase()));
    }
    if (line.hasOption("i")) {
        dto.setId(new Long(line.getOptionValue("i")));
    }
    return dto;

}

From source file:com.fusesource.forge.jmstest.peristence.ProbeAwarePeristenceAdapter.java

public long getStartTime() {
    if (startTime == null) {
        startTime = new Long(System.currentTimeMillis() / 1000);
    }/*  www.  ja v a  2s.c  o m*/
    return startTime.longValue();
}

From source file:com.webfileanalyzer.testservice.FilesServiceTest.java

@Test
public void getFilesLineMoreThentest() {
    for (Files f : fileService.getFilesLineMoreThen(new Long(1)))
        log.info(f);
}

From source file:org.androidpn.server.service.impl.ApnUserServiceImpl.java

public ApnUser getApnUser(String id) {
    return apnUserDao.getApnUser(new Long(id));
}