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.intuit.tank.vm.settings.AgentConfigCpTest.java

/**
 * Run the AgentConfig(HierarchicalConfiguration) constructor test.
 * /*www  .  j ava  2  s. co m*/
 * @throws Exception
 * 
 * @generatedBy CodePro at 9/3/14 3:44 PM
 */
@Test
public void testAgentConfig_1() throws Exception {
    HierarchicalConfiguration config = new HierarchicalConfiguration();

    AgentConfig result = new AgentConfig(config);

    assertNotNull(result);
    assertEquals(new Long(40000L), result.getConnectionTimeout());
    assertEquals(false, result.getLogVariables());
    assertEquals(false, result.getLogPostResponse());
    assertEquals(8090, result.getAgentPort());
    assertEquals(false, result.getLogPostRequest());
    assertEquals(90000L, result.getSSLTimeout());
    assertEquals(5000L, result.getMaxAgentResponseTime());
    assertEquals(180000L, result.getMaxAgentWaitTime());
    assertEquals("/tmp", result.getAgentDataFileStorageDir());
    assertEquals(15, result.getTPSPeriod());
    assertEquals(7200000L, result.getOverSimulationMaxTime());
    assertEquals(5000, result.getMaxBodyReportSize());
    assertEquals(null, result.getDefaultResultProvider());
}

From source file:com.tecapro.inventory.common.util.StringUtil.java

/**
 * Converter long to String//ww  w  .j  av a2 s  .c o m
 * 
 * @param value
 *            long
 * @param defaultValue
 *            String
 * @return String
 */
public String toString(long value) {
    return new Long(value).toString();
}

From source file:com.hs.mail.imap.dao.MySqlMailboxDao.java

public boolean mailboxExists(long ownerID, String mailboxName) {
    String sql = "SELECT COUNT(1) FROM mailbox USE INDEX (fk_mailbox_user) WHERE ownerid = ? AND name = ?";
    return queryForInt(sql, new Object[] { new Long(ownerID), mailboxName }) > 0;
}

From source file:adf.page.Client.ModelBean.java

public ModelBean(String s) {
    messageId = new Long(0);

    title = s;

    nickName = s;

    replies = 0;

    date = new Date();
}

From source file:org.zilverline.web.EditCollectionController.java

/**
 * Adjust the CommandClass based on the implementation used for
 * DocumentCollection./*from  w  ww.  j a  v a2  s. c o  m*/
 * 
 * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest)
 */
protected Object formBackingObject(HttpServletRequest request) throws ServletException {
    // get the Collection (from the collectionManager) referred to by id in
    // the request
    DocumentCollection collection = collectionManager
            .getCollection(new Long(RequestUtils.getRequiredLongParameter(request, "collectionId")));
    if (collection instanceof IMAPCollection) {
        setFormView("collectionIMAPForm");
        setCommandClass(IMAPCollection.class);
        setValidator(null);
        return (IMAPCollection) collection;
    } else if (collection instanceof FileSystemCollection) {
        setFormView("collectionForm");
        setCommandClass(FileSystemCollection.class);
        setValidator(new CollectionValidator());
        return (FileSystemCollection) collection;
    }

    return (FileSystemCollection) collection;
}

From source file:com.googlecode.psiprobe.controllers.cluster.ClusterStatsController.java

protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
        throws Exception {
    TomcatContainer container = getContainerWrapper().getTomcatContainer();
    Cluster cluster = getClusterWrapper().getCluster(container.getName(), container.getHostName(),
            isLoadMembers());/*from   w  w  w .  j  a v a2 s  . co m*/
    return new ModelAndView(getViewName()).addObject("cluster", cluster).addObject("collectionPeriod",
            new Long(getCollectionPeriod()));
}

From source file:com.redhat.rhn.manager.kickstart.IpAddressRange.java

/**
 *
 * @param minIn min ip long coming in//from   w w  w.  ja  v a  2s  .com
 * @param maxIn max ip long coming in
 * @param ksidIn long id of ks data
 */
public IpAddressRange(long minIn, long maxIn, long ksidIn) {
    this(minIn, maxIn, new Long(ksidIn));
}

From source file:com.nectify.hornet.HornetImpl.java

public String createAccessToken(String... channels) {
    long timestamp = Math.round(System.currentTimeMillis() / 1000);

    String suffix = StringUtils.leftPad("" + timestamp, 10, '0')
            + StringUtils.leftPad("" + (new Random()).nextInt(10000), 5, '0');

    Jedis jedis = pool.getResource();/*w w w  . jav  a  2 s  .c o m*/

    String token = null;

    try {
        long nextTokenId = jedis.incr("hornet:tokens_id");

        Long tokenBase10 = new Long(nextTokenId + suffix);
        token = HornetUtils.converter(62, tokenBase10);

        String key = "hornet:token:" + token;

        for (int i = 0; i < channels.length; i++) {
            String channel = channels[i];

            jedis.sadd(key, channel);
        }

        jedis.expire(key, tokenTTL);
    } finally {
        pool.returnResource(jedis);
    }

    return token;
}

From source file:TestJSONStringBuffer.java

public void testObjectInObject() {
    try {/*from   ww  w. j a va 2 s  . co m*/
        JSONStringBuffer buf = new JSONStringBuffer();
        buf.append(objectInObject[0]);
        assertEquals(false, buf.stringsAvailable());
        buf.append(objectInObject[1]);
        assertEquals(false, buf.stringsAvailable());
        buf.append(objectInObject[2]);
        assertEquals(true, buf.stringsAvailable());
        ArrayList<String> strings = buf.retrieveAvailableStrings();
        assertEquals(1, strings.size());
        Object o = new Decoder().decode(strings.get(0));
        assertNotNull(o);
        assertEquals(JSONObject.class, o.getClass());
        JSONObject obj1 = (JSONObject) ((JSONObject) o).get("obj1");
        assertEquals(JSONObject.class, obj1.getClass());
        JSONObject obj2 = (JSONObject) obj1.get("obj2");
        assertEquals(JSONObject.class, obj2.getClass());
        Long obj3 = (Long) obj2.get("obj3");
        assertEquals(Long.class, obj3.getClass());
        assertEquals(new Long(42), obj3);
    } catch (Exception e) {
        System.err.println(e);
        fail();
    }
}

From source file:org.drizzly.MySQLConnectionTest.java

@Test
public void testGetEmployeeById() {
    Long empId = new Long(1);
    EmployeeManager emp = new EmployeeManager();
    System.out.println(emp.getEmployeeDetails(Long.valueOf("1")));
    Assert.notNull(emp);/*ww  w  .ja v a  2  s . c  om*/
}