Example usage for java.lang Long parseLong

List of usage examples for java.lang Long parseLong

Introduction

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

Prototype

public static long parseLong(String s) throws NumberFormatException 

Source Link

Document

Parses the string argument as a signed decimal long .

Usage

From source file:com.mycompany.CRMFly.Converters.EventConverter.java

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

    Long id = Long.parseLong(value.split(" ")[0]);
    return eventBean.getEventForId(id);

}

From source file:cz.strmik.cmmitool.web.controller.propertyeditor.MethodEditor.java

@Override
public void setAsText(String text) {
    if (StringUtils.isEmpty(text)) {
        setValue(null);/*from   w w  w .j av a2  s . c  o  m*/
    } else {
        setValue(methodDao.read(Long.parseLong(text)));
    }
}

From source file:br.ufg.calendario.converters.InteressadoConverter.java

@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
    try {//w  w  w  . j a v  a 2 s .c o  m
        Interessado interessado = interessadoDao.buscarPorId(Long.parseLong(value));
        return interessado;
    } catch (NumberFormatException e) {
        return null;
    }
}

From source file:com.mycompany.CRMFly.Converters.RequestConverter.java

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

    Long id = Long.parseLong(value.split(" ")[0]);
    //   String id= value.split(" ")[0];
    return requestBean.getRequestForId(id);

}

From source file:com.teradata.benchto.service.rest.converters.ZonedDateTimeConverter.java

@Override
public ZonedDateTime convert(String source) {
    return Instant.ofEpochMilli(Long.parseLong(source)).atZone(ZoneId.of("UTC"));
}

From source file:com.mycompany.CRMFly.Converters.ClientConverter.java

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

    Long id = Long.parseLong(value.split(" ")[0]);
    //   String id= value.split(" ")[0];
    return clientBean.getClientForId(id);

}

From source file:com.mycompany.CRMFly.Converters.PaymentConverter.java

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

    Long id = Long.parseLong(value.split(" ")[0]);
    return paymentBean.getPaymentForId(id);

}

From source file:com.mycompany.CRMFly.Converters.ProductConverter.java

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

    Long id = Long.parseLong(value.split(" ")[0]);
    return productBean.getProductForId(id);

}

From source file:com.mycompany.CRMFly.Converters.ProjectConverter.java

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

    Long id = Long.parseLong(value.split(" ")[0]);
    return projectBean.getProjectForId(id);

}

From source file:TestTpy.java

@Test
public void testTime() {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
    String time = sdf.format(new Date(Long.parseLong("1466675562257")));
    System.out.print(" ===" + time);
}