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:Main.java

/**
 * When the amount is stored as a long it is in pennies...so $10.25 is stored
 * as 1025 pennies. This method will convert 1025 into the string 10.25
 * //from  w  ww  .j  a  v a  2s  .  co  m
 * @param amount
 * @return
 */
public static String convertAmount(Long amount) {
    String displayAmount = "0.00";
    if (amount != null) {
        displayAmount = amount.toString();
        if (displayAmount.length() > 2) {
            displayAmount = displayAmount.substring(0, displayAmount.length() - 2) + "."
                    + displayAmount.substring(displayAmount.length() - 2, displayAmount.length());
        } else {
            displayAmount = "0." + displayAmount;
        }
    }
    return displayAmount;
}

From source file:com.ignorelist.kassandra.steam.scraper.JsonApiTagLoader.java

private static String buildApiUrl(Long gameId) {
    return buildApiUrl(gameId.toString());
}

From source file:me.adaptive.che.infrastructure.vfs.WorkspaceIdLocalFSMountStrategy.java

public static String getWorkspaceFolderName(Long workspaceId) {
    return DigestUtils.md5Hex(workspaceId.toString());
}

From source file:co.tuzza.swipehq.models.BaseRequest.java

public static void addIfhasValue(String key, Long value, Map<String, String> params) {
    if (value != null) {
        params.put(key, value.toString());
    }/*w ww  . j  a v  a  2s.  c o m*/
}

From source file:io.milton.common.RangeUtils.java

public static String toRangeString(long start, long finish, Long totalLength) {
    String l = totalLength == null ? "*" : totalLength.toString();

    String s = null;//  w  w  w .  j a  v  a  2s .  c om
    if (finish > -1) {
        s = "bytes " + start + "-" + finish + "/" + l;
    } else {
        long wrotetill = totalLength == null ? 0 : totalLength - 1;
        //The end position starts counting at zero. So subtract 1
        s = "bytes " + start + "-" + wrotetill + "/" + l;
    }
    return s;
}

From source file:com.ignorelist.kassandra.steam.scraper.HtmlTagLoader.java

private static String buildPageUrl(Long k) {
    return buildPageUrl(k.toString());
}

From source file:com.codenvy.cas.util.LdapUtils.java

/**
 * Reads a Long value from the LdapEntry.
 *
 * @param entry       the ldap entry//  w ww.  ja v  a2s .com
 * @param attribute the attribute name
 * @param nullValue the value which should be returning in case of a null value
 * @return the long value
 */
public static Long getLong(final LdapEntry entry, final String attribute, final Long nullValue) {
    final String v = getString(entry, attribute, nullValue.toString());
    if (v != null && NumberUtils.isNumber(v)) {
        return Long.valueOf(v);
    }
    return nullValue;
}

From source file:ntpgraphic.PieChart.java

public static void processResponse(TimeInfo info, int i) {
    info.computeDetails();/*from  ww  w  .j a  va  2  s . c o m*/
    Long offsetValue = info.getOffset();
    Long delayValue = info.getDelay();
    String delay = (delayValue == null) ? "N/A" : delayValue.toString();
    String offset = (offsetValue == null) ? "N/A" : offsetValue.toString();
    if (delayValue == null) {
        delayValue = (long) 0;
    }
    switch (i) {
    case 1:
        offset1 = (int) (long) offsetValue;
        break;
    case 2:
        offset2 = (int) (long) offsetValue;
        break;
    case 3:
        offset3 = (int) (long) offsetValue;
        break;
    case 4:
        series4.add(i, delayValue);
        break;
    }

    System.out.println(" Roundtrip delay(ms)=" + delay + ", clock offset(ms)=" + offset); // offset in ms
    //Promedio=Promedio+offsetValue;
    //Cant=Cant+1;
}

From source file:ntpgraphic.LineChart.java

public static void processResponse(TimeInfo info, int i) {
    info.computeDetails();//from  w w  w.j ava  2 s.c om
    Long offsetValue = info.getOffset();
    Long delayValue = info.getDelay();
    String delay = (delayValue == null) ? "N/A" : delayValue.toString();
    String offset = (offsetValue == null) ? "N/A" : offsetValue.toString();
    if (delayValue == null) {
        delayValue = (long) 0;
    }
    switch (serie) {
    case 1:
        series1.add(i, delayValue);
        break;
    case 2:
        series2.add(i, delayValue);
        break;
    case 3:
        series3.add(i, delayValue);
        break;
    case 4:
        series4.add(i, delayValue);
        break;
    }
    serie++;

    System.out.println(" Roundtrip delay(ms)=" + delay + ", clock offset(ms)=" + offset); // offset in ms
    //Promedio=Promedio+offsetValue;
    //Cant=Cant+1;
}

From source file:com.todo.backend.security.JWTUtils.java

public static String createToken(Long userId, UserRole userRole, String secretKey) {

    final ZonedDateTime validity = ZonedDateTime.now(ZoneId.of("UTC")).plusSeconds(VALIDITY);

    return Jwts.builder().setSubject(userId.toString()).claim(AUTHORITIES_KEY, userRole.name())
            .signWith(SignatureAlgorithm.HS512, secretKey).setExpiration(Date.from(validity.toInstant()))
            .compact();//from w ww.j  av  a2 s. c o  m
}