Example usage for java.lang String valueOf

List of usage examples for java.lang String valueOf

Introduction

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

Prototype

public static String valueOf(double d) 

Source Link

Document

Returns the string representation of the double argument.

Usage

From source file:Main.java

private static String toIdName(String fieldName) {
    String idName = String.valueOf(Character.toLowerCase(fieldName.charAt(1)));

    for (int i = 2, length = fieldName.length(); i < length; ++i) {
        char c = fieldName.charAt(i);
        if (Character.isUpperCase(c)) {
            idName = idName + ID_SEPARATOR + Character.toLowerCase(c);
        } else {//from   ww  w .  j a  v  a2s .c  o  m
            idName += c;
        }
    }

    return idName;
}

From source file:Main.java

private static String getHashCode(String url) {
    if (!TextUtils.isEmpty(url)) {
        return String.valueOf(url.hashCode());
    }/*  w ww .  ja  va2  s  . c  om*/
    return null;
}

From source file:Main.java

public static String convertIntToString(int input) {

    String valueToString = "0";

    try {//from   w ww.j a v  a 2s .co  m
        valueToString = String.valueOf(input);
    } catch (Exception e) {
        valueToString = "0";
    }

    return valueToString;
}

From source file:Main.java

public static String getTimestamp() {
    long time = System.currentTimeMillis() / 1000;
    return String.valueOf(time);
}

From source file:Main.java

public static <T> T checkNotNull(T reference, Object errorMessage) {
    if (reference == null) {
        throw new NullPointerException(String.valueOf(errorMessage));
    } else {/*  w  ww.j a v  a  2s . c om*/
        return reference;
    }
}

From source file:Main.java

public static String asString(Camera.Size resolution) {
    return String.valueOf(resolution.width) + "x" + String.valueOf(resolution.height);
}

From source file:Main.java

public static String formatNumber2Thousand(int num) {
    if (num / 1000 <= 0)
        return String.valueOf(num);
    return append(String.format("%.1f", (float) num / 1000f), "k");
}

From source file:com.moviejukebox.model.artwork.ArtworkPriority.java

/**
 * Convert a string into an Enum type//from w w w.ja  va  2s . c  o  m
 *
 * @param artworkPriority
 * @return
 * @throws IllegalArgumentException If not recognised
 *
 */
public static ArtworkPriority fromString(final String artworkPriority) {
    if (StringUtils.isNotBlank(artworkPriority)) {
        try {
            return ArtworkPriority.valueOf(artworkPriority.trim().toUpperCase());
        } catch (IllegalArgumentException ex) {
            throw new IllegalArgumentException("ArtworkPriority '" + artworkPriority + "' does not exist.", ex);
        }
    }
    throw new IllegalArgumentException("ArtworkPriority must not be null");
}

From source file:Main.java

/**
 * Build.VERSION.RELEASE
 *
 * @return
 */
public static String getOsVersion() {
    return String.valueOf(Build.VERSION.RELEASE);
}

From source file:Main.java

public static String getfullTimeToStringMills(String timeString) {
    return String.valueOf(timeToMills(timeString));
}