List of usage examples for java.lang Integer toString
public String toString()
From source file:edu.lternet.pasta.client.PastaClient.java
/** * Composes the PASTA URL from the PASTA hostname and PASTA protocol values * specified in the dataportal.properties file. * /*from w w w . j a v a 2 s. c o m*/ * @param pastaProtocol The PASTA protocol, e.g. "http" * @param pastaHostname The PASTA hostname, e.g. "pasta-s.lternet.edu" * @param pastaPort The PASTA port value, e.g. 8888 (may be null or empty string) * @return a string representing the PASTA URL */ public static String composePastaUrl(String pastaProtocol, String pastaHostname, Integer pastaPort) { String pastaUrl = pastaProtocol + "://" + pastaHostname; if (pastaPort != null && pastaPort > 0) { pastaUrl += ":" + pastaPort.toString(); } return pastaUrl; }
From source file:de.micromata.genome.gwiki.plugin.rogmp3_1_0.Track.java
static String[] buildRecFromFile(Title title, File mp3file, int no) { String[] rec = new String[REC_SICE]; String key = "" + title.getPk() + "_" + no; Integer pk = synteticTracks.get(key); if (pk == null) { pk = nextSynteticTrackPk();// w ww . j av a2 s. c o m synteticTracks.put(key, pk); } rec[PK] = pk.toString(); rec[FK_TITLE] = title.getPk(); rec[NAME] = mp3file.getName(); rec[NAMEONCD] = mp3file.getName(); return rec; }
From source file:eulermind.Style.java
public static Style newStyle() { Integer name_postfix = 0; String name = "new Style"; while (Style.hasStyle(name)) { name = "new style" + name_postfix.toString(); name_postfix++;//from w ww .j ava2 s. c om } Style style = new Style(name); Style.addStyle(style); return style; }
From source file:com.jwebmp.core.utilities.EscapeChars.java
/** * Adds padding to string builder//from w ww .j a v a 2s . c o m * * @param index * @param stringBuilder */ public static void addCharEntity(Integer index, StringBuilder stringBuilder) { String padding = ""; if (index <= 9) { padding = "00"; } else if (index <= 99) { padding = "0"; } else { //no prefix } String number = padding + index.toString(); stringBuilder.append("&#").append(number).append(";"); }
From source file:com.nridge.core.base.std.XMLUtl.java
public static void makeElemIntValue(Document aDocument, Element anElement, String aName, int aValue) { Integer intObject; Element subElement;//from w w w. j ava 2s .c o m if (StringUtils.isNotEmpty(aName)) { intObject = aValue; subElement = aDocument.createElement(aName); subElement.appendChild(aDocument.createTextNode(intObject.toString())); anElement.appendChild(subElement); } }
From source file:com.thoughtworks.go.domain.materials.dependency.DependencyMaterialRevision.java
public static DependencyMaterialRevision create(String pipelineName, Integer pipelineCounter, String pipelineLabel, String stageName, int stageCounter) { if (pipelineCounter == null) { throw new IllegalArgumentException( "Dependency material revision can not be created without pipeline counter."); }/*from www. j a v a 2 s. c om*/ return new DependencyMaterialRevision(pipelineName, pipelineCounter.toString(), pipelineLabel, stageName, stageCounter); }
From source file:com.kunckle.jetpower.core.base.repository.impl.BaseRepositorySupport.java
/** * ?QL??/*from www .j av a2 s.com*/ * * @param ids ? * @return " ( [item1],[item2],... ) " */ public static String toArrayInSQL(Integer[] ids) { String temp = ""; for (Integer e : ids) { temp += e.toString() + ","; } temp = temp.substring(0, temp.length() - 1); return "(" + temp + ") "; }
From source file:com.clearcenter.mobile_demo.mdRest.java
static public String GetSystemInfo(String host, String token, long last_sample) throws JSONException, ParseException, IOException, AuthenticationException { try {//w w w .j ava 2s .c o m URL url = new URL("https://" + host + URL_SYSINFO + "/" + last_sample); Log.v(TAG, "GetSystemInfo: host: " + host + ", token: " + token + ", URL: " + url); HttpsURLConnection http = CreateConnection(url); http.setRequestMethod("GET"); http.setRequestProperty("Cookie", token); final StringBuffer response = ProcessRequest(http); // Process response JSONObject json_data = null; try { //Log.i(TAG, "response: " + response.toString()); json_data = new JSONObject(response.toString()); } catch (JSONException e) { Log.e(TAG, "JSONException", e); return ""; } if (json_data.has("result")) { Integer result = RESULT_UNKNOWN; try { result = Integer.valueOf(json_data.getString("result")); } catch (NumberFormatException e) { } Log.d(TAG, "result: " + result.toString()); if (result == RESULT_SUCCESS && json_data.has("data")) { //Log.i(TAG, "data: " + json_data.getString("data")); return json_data.getString("data"); } if (result == RESULT_ACCESS_DENIED) throw new AuthenticationException(); // New cookies? final String cookie = http.getHeaderField("Set-Cookie"); if (cookie != null) { Log.d(TAG, "New cookie!"); } // All other results are failures... throw new IOException(); } } catch (MalformedURLException e) { Log.e(TAG, "MalformedURLException", e); throw new ParseException(); } Log.i(TAG, "Malformed result"); throw new IOException(); }
From source file:com.cloud.utils.UriUtils.java
public static String formIscsiUri(String host, String iqn, Integer lun) { try {/*from w w w . ja v a2 s . c o m*/ String path = iqn; if (lun != null) { path += "/" + lun.toString(); } URI uri = new URI("iscsi", host, path, null); return uri.toString(); } catch (URISyntaxException e) { throw new CloudRuntimeException("Unable to form iscsi URI: " + host + " - " + iqn + " - " + lun); } }
From source file:com.apptentive.android.sdk.comm.ApptentiveClient.java
/** * Gets all messages since the message specified by guid was sent. * * @return An ApptentiveHttpResponse object with the HTTP response code, reason, and content. *//*from w ww. j a va 2 s . c om*/ public static ApptentiveHttpResponse getMessages(Integer count, String afterId, String beforeId) { String uri = String.format(ENDPOINT_CONVERSATION_FETCH, count == null ? "" : count.toString(), afterId == null ? "" : afterId, beforeId == null ? "" : beforeId); return performHttpRequest(GlobalInfo.conversationToken, uri, Method.GET, null); }