Example usage for java.lang Long toString

List of usage examples for java.lang Long toString

Introduction

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

Prototype

public String toString() 

Source Link

Document

Returns a String object representing this Long 's value.

Usage

From source file:com.taobao.ad.es.common.test.ShellHttpJobExecutorTest.java

@Before
 public void init() {
     jobData = new JobData();
     jobData.setJobId("1234");
     jobData.setJobGroup("123");
     jobData.setJobName("testDTJob");
     jobData.setJobType(JobData.JOBTYPE_SHELLJOB);
     Long signTime = System.currentTimeMillis() / 1000;
     String token = TokenUtils.generateToken(signTime.toString());
     jobData.setSignTime(signTime.toString());
     jobData.setToken(token);/*from w w w .jav a2 s.c om*/
     jobData.setSync(true);
     Map<String, String> data = new HashMap<String, String>();
     //data.put(Const.JOBDATA_DATA_JOBCOMMAND, "echo");
     jobData.setData(data);
 }

From source file:org.apache.streams.data.data.util.DateTimeSerDeTest.java

@Test
public void testMillisDeser() {
    Long input = 1326856906000l;
    try {//from   w  w  w.  j  a  v  a2  s  .  co m
        DateTime output = mapper.readValue(input.toString(), DateTime.class);
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail();
    }
}

From source file:br.ufac.sion.converter.LocalidadeConverter.java

@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {

    if (value != null) {
        Long codigo = ((Localidade) value).getId();
        String retorno = (codigo == null ? null : codigo.toString());

        return retorno;
    }//from   w w  w .  ja v a 2 s .  co  m
    return null;
}

From source file:br.ufac.sion.inscricao.converter.OrgaoExpedidorConverter.java

public String getAsString(FacesContext context, UIComponent component, Object value) {
    if (value != null) {
        Long codigo = ((OrgaoExpedidor) value).getId();
        String retorno = (codigo == null ? null : codigo.toString());

        return retorno;
    }/*from   w  w  w .j  a v a  2  s .  com*/
    return null;
}

From source file:com.eyem.services.PostService.java

public List<Post> buscarPostGrupo(Long idGrupo) {
    List<Post> res = postRepository.buscarPostGrupo(idGrupo.toString());
    if (res.isEmpty() || res.size() <= 0) {
        return null;
    } else {/*from   w w  w.ja va2 s. c  o  m*/
        Collections.sort(res);
        return res;
    }
}

From source file:uk.org.funcube.fcdw.controller.WodController.java

@RequestMapping(value = "/{satelliteId}", method = RequestMethod.GET)
public ModelAndView getSatellite(@PathVariable("satelliteId") Long satelliteId) {
    ModelAndView model = new ModelAndView("wod");
    model.addObject("satelliteId", satelliteId.toString());
    return model;
}

From source file:uk.org.funcube.fcdw.controller.HiresController.java

@RequestMapping(value = "/{satelliteId}", method = RequestMethod.GET)
public ModelAndView getSatellite(@PathVariable("satelliteId") Long satelliteId) {
    ModelAndView model = new ModelAndView("hires");
    model.addObject("satelliteId", satelliteId.toString());
    return model;
}

From source file:com.aurel.track.util.PluginUtils.java

public static void extractArchiveFromClasspath(String dirInClasspath, String filter, File toDir) {
    URL urlDest;/*from  w w w .j a v  a 2 s .co m*/
    File directory = null;
    //first try to get the template dir through class.getResource(path)
    urlDest = PluginUtils.class.getResource(dirInClasspath); // example: "/plugins"
    urlDest = PluginUtils.createValidFileURL(urlDest);
    if (urlDest != null) {
        LOGGER.info("Retrieving archive from " + urlDest.toString());
        directory = new File(urlDest.getPath());
        Long uuid = new Date().getTime();
        File tmpDir = new File(
                System.getProperty("java.io.tmpdir") + File.separator + "TrackTmp" + uuid.toString());
        if (!tmpDir.isDirectory()) {
            tmpDir.mkdir();
        }
        tmpDir.deleteOnExit();

        File[] files = null;

        if (filter != null && !"".equals(filter)) {
            files = directory.listFiles(new PluginUtils.Filter(filter));
        } else {
            files = directory.listFiles();
        }

        if (files == null || files.length == 0) {
            LOGGER.info("Problem extracting archive: No files.");
            return;
        }
        for (int index = 0; index < files.length; index++) {
            File zipFile = null;
            try {
                zipFile = files[index];
                LOGGER.info("Extracting archive from " + files[index].getName());
                unzipFileIntoDirectory(zipFile, toDir);
            } catch (Exception e) {
                LOGGER.error("Problem unzipping archive " + files[index].getName());
                LOGGER.debug(ExceptionUtils.getStackTrace(e));
            }
        }
    }
}

From source file:uk.org.funcube.fcdw.controller.RealtimeController.java

@RequestMapping(value = "/{satelliteId}", method = RequestMethod.GET)
public ModelAndView getSatellite(@PathVariable("satelliteId") Long satelliteId) {
    ModelAndView model = new ModelAndView("realtime");
    model.addObject("satelliteId", satelliteId.toString());
    return model;
}

From source file:com.redhat.rhn.testing.TestUtils.java

/**
 * Get a request with a Session and a User.
 * @return a request with a Session and a User.
 *//*  ww  w.  j ava 2s . c  o m*/
public static RhnMockHttpServletRequest getRequestWithSessionAndUser() {
    LoggingFactory.clearLogId();
    RhnMockHttpServletRequest req = new RhnMockHttpServletRequest();
    RhnMockHttpServletResponse resp = new RhnMockHttpServletResponse();
    RhnMockHttpSession session = new RhnMockHttpSession();
    req.setupServerName("mymachine.rhndev.redhat.com");
    req.setSession(session);

    User u = null;
    try {
        u = UserTestUtils.createUserInOrgOne();
    } catch (Exception e) {
        e.printStackTrace();
    }
    u.removePermanentRole(RoleFactory.ORG_ADMIN);
    Long userid = u.getId();

    RequestContext requestContext = new RequestContext(req);
    PxtSessionDelegateFactory pxtDelegateFactory = PxtSessionDelegateFactory.getInstance();

    PxtSessionDelegate pxtDelegate = pxtDelegateFactory.newPxtSessionDelegate();

    WebSession s = requestContext.getWebSession();

    PxtCookieManager pxtCookieManager = new PxtCookieManager();
    req.addCookie(pxtCookieManager.createPxtCookie(s.getId(), req, 10));

    pxtDelegate.updateWebUserId(req, resp, userid);

    req.addCookie(resp.getCookie("pxt-session-cookie"));
    req.setupAddParameter("uid", userid.toString());

    return req;
}