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

public static String convertKB2MB(String byteInKb) {
    int kb = Integer.parseInt(byteInKb);
    return String.valueOf(kb >>> 10);
}

From source file:Main.java

private static String getCustomDimensionKey(int paramInt) {
    return String.format("%s%s", new Object[] { "c", String.valueOf(paramInt - 1) });
}

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

/**
 * Convert a string into an Enum type//w ww.j ava  2s  .  com
 *
 * @param artworkSize
 * @return
 * @throws IllegalArgumentException If type is not recognised
 *
 */
public static ArtworkSize fromString(String artworkSize) {
    if (StringUtils.isNotBlank(artworkSize)) {
        try {
            return ArtworkSize.valueOf(artworkSize.trim().toUpperCase());
        } catch (IllegalArgumentException ex) {
            throw new IllegalArgumentException("ArtworkSize " + artworkSize + " does not exist.", ex);
        }
    }
    throw new IllegalArgumentException("ArtworkSize must not be null");
}

From source file:Main.java

public static String attributeToString(int att, int bad_Value) {
    return (att == bad_Value ? "?" : String.valueOf(att));
}

From source file:Main.java

public static byte stringToHexBytes(int obj) {
    byte hex = 0;
    String aim = null;/*w  w w . ja v  a  2s . c o  m*/
    aim = String.valueOf(obj);
    if (aim != null && !aim.trim().equals(" ")) {
        hex = Byte.parseByte(aim, 16);
    }
    return hex;
}

From source file:Main.java

private static String analyzeFieldName(String methodName) {
    return String.valueOf(methodName.charAt(3)).toLowerCase() + methodName.substring(4, methodName.length());
}

From source file:Main.java

public static String getSimpleBusLineName(String busLineName) {
    if (busLineName == null) {
        return String.valueOf("");
    }/*from  w ww.jav a  2  s . c  om*/
    return busLineName.replaceAll("\\(.*?\\)", "");
}

From source file:Main.java

private static String padSuraNumber(int number) {
    return number < 10 ? "00" + number : number < 100 ? "0" + number : String.valueOf(number);
}

From source file:Main.java

public static String year() {
    Calendar cal = Calendar.getInstance();
    return String.valueOf(cal.get(Calendar.YEAR));
}

From source file:com.omertron.themoviedbapi.enumeration.MediaType.java

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