Example usage for java.lang Long valueOf

List of usage examples for java.lang Long valueOf

Introduction

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

Prototype

@HotSpotIntrinsicCandidate
public static Long valueOf(long l) 

Source Link

Document

Returns a Long instance representing the specified long value.

Usage

From source file:ch.rasc.extclassgenerator.validation.LengthValidation.java

public LengthValidation(String field, Integer min, Integer max) {
    this(field, min != null ? Long.valueOf(min) : null, max != null ? Long.valueOf(max) : null);
}

From source file:xx.tream.chengxin.ms.service.TrainServiceImpl.java

public void delete(long id) {
    this.dao.delete(Train.class, Long.valueOf(id));
}

From source file:net.ceos.project.poi.annotated.bean.ConditionalFormatObjectBuilder.java

/**
 * Create a ConditionalFormatObject for tests.
 * //from ww  w.  j  a  v a 2s. c  o  m
 * @return the {@link ConditionalFormatObject}
 */
public static ConditionalFormatObject buildConditionalFormatObject(int multiplier) {
    ConditionalFormatObject toValidate = new ConditionalFormatObject();

    toValidate.setDateAttribute(new Date());
    toValidate.setStringAttribute("Cascade L2");
    toValidate.setIntegerAttribute(46 * multiplier);
    toValidate.setDoubleAttribute(Double.valueOf("25.3") * multiplier);
    toValidate.setLongAttribute(Long.valueOf("1234567890") * multiplier);
    toValidate.setBooleanAttribute(Boolean.FALSE);
    /* create sub object Job */
    Job job = new Job();
    job.setJobCode(0005);
    job.setJobFamily("Family Job Name L2");
    job.setJobName("Job Name L2");
    toValidate.setJob(job);

    return toValidate;
}

From source file:lirmm.inria.fr.math.OpenLongToDoubleHashMapTest.java

@Before
public void setUp() throws Exception {
    javaMap.put(Long.valueOf(50), 100.0);
    javaMap.put(Long.valueOf(75), 75.0);
    javaMap.put(Long.valueOf(25), 500.0);
    javaMap.put(Long.MAX_VALUE, Double.MAX_VALUE);
    javaMap.put(Long.valueOf(0), -1.0);
    javaMap.put(Long.valueOf(1), 0.0);
    javaMap.put(Long.valueOf(33), -0.1);
    javaMap.put(Long.valueOf(23234234), -242343.0);
    javaMap.put(Long.valueOf(23321), Double.MIN_VALUE);
    javaMap.put(Long.valueOf(-4444), 332.0);
    javaMap.put(Long.valueOf(-1), -2323.0);
    javaMap.put(Long.MIN_VALUE, 44.0);
    javaMap.put(Long.valueOf("7263934625316938832"), 224.0);

    /* Add a few more to cause the table to rehash */
    javaMap.putAll(generate());//from  ww  w  .ja v  a 2  s  .  c om

}

From source file:com.greenline.guahao.biz.manager.orderremind.convertors.OrderRemindConvertor.java

public static CustomerApplyQueryDTO convertToCustomerApplyQueryDTO(OrderRemindDO remind) {
    CustomerApplyQueryDTO dto = new CustomerApplyQueryDTO();
    if (null != remind) {
        dto.setPageIndex(1); // ?
        dto.setPageSize(100); // ??
        dto.setCustomerId(null == remind.getCustomerId() ? 0L : Long.valueOf(remind.getCustomerId())); // ?
        dto.setStatus(StringUtils.isBlank(remind.getState()) ? null : Integer.valueOf(remind.getState())); // ?
    }//  w  ww  .j a  v a 2 s.co m
    return dto;
}

From source file:com.nebhale.cyclinglibrary.web.json.TypeJsonSerializerTest.java

@Override
protected Type getValue() {
    return new Type(Long.valueOf(0), "test-name", "test-short-name", Long.valueOf(1), Long.valueOf(2));
}

From source file:com.nebhale.cyclinglibrary.web.json.ItemJsonSerializerTest.java

@Override
protected Item getValue() {
    return new Item(Long.valueOf(0), Long.valueOf(1), Long.valueOf(2), "test-name", "test-short-name");
}

From source file:com.nebhale.cyclinglibrary.web.json.PointJsonSerializerTest.java

@Override
protected Point getValue() {
    return new Point(Long.valueOf(0), Long.valueOf(1), Long.valueOf(2), Long.valueOf(3), Double.valueOf(4),
            Double.valueOf(5), Double.valueOf(6));
}

From source file:com.devnexus.ting.web.converter.StringToEvent.java

@Override
public Event convert(String source) {

    if (StringUtils.isEmpty(source) || !StringUtils.isNumeric(source)) {
        return null;
    } else {/*from w  ww  .j a v a  2 s  . c o  m*/
        return new Event(Long.valueOf(source));
    }

}

From source file:Main.java

/** 
 * Get a GhostMySelfie file path from a Uri. This will get the the path
 * for Storage Access Framework Documents, as well as the _data
 * field for the MediaStore and other file-based ContentProviders.
 * //from w  ww  . j  a v a2 s .  com
 * @param context The context. 
 * @param uri The Uri to query. 
 * 
 * return selfieFilePath
 */
public static String getPath(final Context context, final Uri uri) {
    // Check if the version of current device is greater 
    // than API 19 (KitKat).
    final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;

    // DocumentProvider.
    if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
        // ExternalStorageProvider 
        if (isExternalStorageDocument(uri)) {
            final String docId = DocumentsContract.getDocumentId(uri);
            final String[] split = docId.split(":");
            final String type = split[0];

            if ("primary".equalsIgnoreCase(type)) {
                return Environment.getExternalStorageDirectory() + "/" + split[1];
            }
        }
        // DownloadsProvider 
        else if (isDownloadsDocument(uri)) {
            final String id = DocumentsContract.getDocumentId(uri);
            final Uri contentUri = ContentUris.withAppendedId(Uri.parse(DOWNLOADS_PROVIDER_PATH),
                    Long.valueOf(id));

            return getGhostMySelfieDataColumn(context, contentUri, null, null);
        }
        // MediaProvider 
        else if (isMediaDocument(uri)) {
            final String docId = DocumentsContract.getDocumentId(uri);
            final String[] split = docId.split(":");

            final Uri contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;

            final String selection = "_id = ?";
            final String[] selectionArgs = new String[] { split[1] };

            // Get the FilePath from GhostMySelfie MediStore
            // for given Uri, selection, selectionArgs.
            return getGhostMySelfieDataColumn(context, contentUri, selection, selectionArgs);
        }
    }
    // MediaStore (and general) .
    else if ("content".equalsIgnoreCase(uri.getScheme()))
        return getGhostMySelfieDataColumn(context, uri, null, null);
    // File 
    else if ("file".equalsIgnoreCase(uri.getScheme()))
        return uri.getPath();

    return null;
}