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.cemeterylistingswebtest.test.rest.SearchSurnameControllerTest.java

@Test(enabled = false)
public void testCreate() {
    System.out.println("PublishedDeceasedListing Testing");

    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/SearchSurname/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();
}

From source file:jp.co.acroquest.endosnipe.report.converter.util.calc.LongCalculator.java

public Object mul(Object obj1, Object obj2) {
    Long longData1 = (Long) obj1;
    Long longData2 = (Long) obj2;

    return (Object) (new Long((long) (longData1.longValue() * longData2.longValue())));
}

From source file:com.arindra.project.accounting.controllers.PaymentController.java

@RequestMapping(method = RequestMethod.GET, value = "/create_demo")
public void createDemoPayment() {//@PathVariable("username") String username, @PathVariable("password") String password,@PathVariable("limit") Integer limit){
    Payment payment = new Payment(new Long(1), null, null, null, null, null);
    paymentRepo.save(payment);/*from   w w  w  .  ja v  a  2s  . c  o m*/
}

From source file:com.baidu.stqa.signet.web.action.StatisticsAction.java

/**
 * ?/*from   ww w.j a  v a 2  s  . c o m*/
 * 
 * @param projectId
 * @param storyIds
 * @return
 */
@RequestMapping(value = "/project/{projectId}/statistics", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Map<String, Object>> queryStatistics(@PathVariable long projectId, String storyIds) {
    String[] idStrs = storyIds.split(",");
    List<Long> ids = new ArrayList<Long>();
    for (String id : idStrs) {
        ids.add(new Long(id));
    }
    Map<String, Object> resultMap = statisticsService.queryStatistics(ids, projectId);
    return new ResponseEntity<Map<String, Object>>(resultMap, HttpStatus.OK);
}

From source file:com.jdom.junit.utils.AbstractFixture.java

/**
 * Get a randomized value.//  w  ww.ja  v a2  s .  co  m
 * 
 * @param value
 *            the value to randomize
 * @param salt
 *            the randomizer to use
 * @return the randomized value
 */
public static Long getSaltedValue(Long value, int salt) {
    Long retValue;

    if (salt == 0) {
        retValue = value;
    } else {
        retValue = new Long(value * salt * salt);
    }

    return retValue;
}

From source file:dao.ColMessageDeleteQuery.java

/**
 * Deletes a collabrum message/* ww w . ja v a  2 s  .  c o  m*/
 * @param conn the connection
 * @param ridStr the reply id
 * @param memberid the id of the member
 * @param isAdmin - true if the user is a DiaryAdmin or a Moderator for this collabrum
 * @exception BaseDaoException
 */
public void run(Connection conn, String ridStr, String memberid, boolean isAdmin) throws BaseDaoException {

    Integer rid = new Integer(ridStr);
    Long ownerid = new Long(memberid);

    /**
          *  If user is an admin/organizer, don't check ownerid
          **/
    try {
        if (isAdmin) {
            PreparedStatement stmt = conn
                    .prepareStatement("delete LOW_PRIORITY from collmessages where rid=" + rid + " limit 1");
            stmt.executeUpdate();
        } else {
            PreparedStatement stmt = conn.prepareStatement(
                    "delete from collmessages where rid=" + rid + " and ownerid='" + ownerid + "' limit 1");
            stmt.executeUpdate();
        }
    } catch (Exception e) {
        logger.warn("Error occured while executing db query ", e);
        throw new BaseDaoException("Error occured while executing db query ", e);
    }
}

From source file:org.myjerry.evenstar.web.layout.LayoutController.java

public ModelAndView view(HttpServletRequest request, HttpServletResponse response) throws Exception {
    ModelAndView mav = new ModelAndView();
    String blogID = request.getParameter("blogID");
    mav.setViewName(".admin.layout");
    mav.addObject("blogID", blogID);
    mav.addObject("templateCode", this.blogLayoutService.getBlogTemplate(new Long(blogID)));
    return mav;/*  ww w  . j av a  2 s  .  c o  m*/
}

From source file:gov.nih.nci.cabio.portal.portlet.canned.GridRangeQueryAction.java

@Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest req,
        HttpServletResponse res) throws Exception {

    try {//from  w  ww .  j  a v a2  s  .com
        GridRangeQueryForm f = (GridRangeQueryForm) form;

        GridIdRangeQuery q = new GridIdRangeQuery();
        q.setBigId(f.getGridId());
        q.setAssembly(f.getAssembly());
        q.setDownstreamDistance(new Long(f.getDownstreamPad()));
        q.setUpstreamDistance(new Long(f.getUpstreamPad()));

        Class targetClass = RangeQuery.class;
        if (!"".equals(f.getClassFilter())) {
            targetClass = Class.forName(f.getClassFilter());
        }

        log.info("gridId: " + q.getBigId());
        log.info("assembly: " + q.getAssembly());
        log.info("upstream: " + q.getUpstreamDistance());
        log.info("downstream: " + q.getDownstreamDistance());
        log.info("page: " + f.getPage());
        log.info("targetClass: " + targetClass.getName());

        List results = as.search(targetClass, q);
        log.info("result size: " + results.size());

        req.setAttribute("results", new Results(results, f.getPageNumber()));

        return mapping.findForward("cabioportlet.gridRangeQuery.results");
    } catch (Exception e) {
        log.error("Action error", e);
        req.setAttribute("errorMessage", e.getMessage());
        return mapping.findForward("cabioportlet.error");
    }
}

From source file:fr.gael.dhus.datastore.HierarchicalDirectoryBuilder.java

public HierarchicalDirectoryBuilder(File root, int max_occurence) {
    this.root = root;
    this.maxOccurence = new Long(max_occurence);

}

From source file:org.apache.struts2.showcase.person.PersonManager.java

public void createPerson(Person person) {
    person.setId(new Long(++COUNT));
    people.add(person);
}