List of usage examples for java.lang Integer toString
public String toString()
From source file:edu.umass.cs.utils.Util.java
public static Set<String> arrayOfIntToStringSet(int[] array) { Set<String> set = new HashSet<String>(); for (Integer member : array) { set.add(member.toString()); }//from w w w . j ava 2 s . com return set; }
From source file:airlift.util.AirliftUtil.java
/** * Convert integer to byte array.//from ww w. ja v a 2 s . c o m * * @param _number the _number * @return the byte[] */ public static byte[] convert(java.lang.Integer _number) { return (_number == null) ? null : convert(_number.toString()); }
From source file:es.juntadeandalucia.panelGestion.negocio.utiles.Utils.java
public static String getEPSG(Integer srid) { String epsg = null;//from w w w .j a v a 2s .c o m if (srid != null) { epsg = "EPSG:".concat(srid.toString()); } return epsg; }
From source file:eu.e43.impeller.Utils.java
public static String formatHtmlFragment(String fragment, Integer width) { final String base = "<html>" + "<head>" + "<meta name=\"viewport\" content=\"width=%s, user-scalable=no\">" + "<style>" + "body { margin: 0; }" + "img, video, object, iframe { max-width: 100%%; } " + "</style>" + "</head>" + "<body>%s</body>" + "</html>"; String strWidth = "device-width"; if (width != null) strWidth = width.toString(); return String.format(base, strWidth, fragment); }
From source file:com.opengamma.analytics.financial.provider.curve.MulticurveBuildingDiscountingDiscountUSD2Test.java
private static ZonedDateTimeDoubleTimeSeries[] getTSSwapFixedON(final Boolean withToday, final Integer unit) { switch (unit) { case 0:/*from ww w .jav a2 s . co m*/ return withToday ? TS_FIXED_OIS_USD_WITH_TODAY : TS_FIXED_OIS_USD_WITHOUT_TODAY; default: throw new IllegalArgumentException(unit.toString()); } }
From source file:com.vinexs.tool.XML.java
/** * Convert a string to its possible data type. * * @param string String to be converted. * @return Value in Boolean, Null, Integer, Double or String. *//* ww w .j a v a2 s . c om*/ public static Object stringToValue(String string) { if ("true".equalsIgnoreCase(string)) { return Boolean.TRUE; } if ("false".equalsIgnoreCase(string)) { return Boolean.FALSE; } if ("null".equalsIgnoreCase(string)) { return JSONObject.NULL; } if (Determinator.isNumeric(string)) { if (Determinator.isInteger(string)) { Integer strInt = Integer.valueOf(string); if (strInt.toString().equals(string)) { return strInt; } } return Double.valueOf(string); } return string; }
From source file:org.opencastproject.remotetest.util.Utils.java
public static String schedulerEvent(Integer duration, String title, String id) throws Exception { Long start = System.currentTimeMillis() + 60000; Long end = start + duration;//from ww w .j ava 2s . co m InputStream is = null; try { is = Utils.class.getResourceAsStream("/scheduler-event.xml"); String event = IOUtils.toString(is, "UTF-8"); return event.replace("@@id@@", id).replace("@@title@@", title).replace("@@start@@", start.toString()) .replace("@@end@@", end.toString()).replace("@@duration@@", duration.toString()); } finally { IOUtils.closeQuietly(is); } }
From source file:module.mailtracking.domain.Year.java
@Atomic public static Year createYearFor(MailTracking mailTracking, Integer forYear) { if (forYear < 2007) { throw new MailTrackingDomainException("error.mail.tracking.year.invalid"); }/*www . java2 s.c o m*/ if (getYearFor(mailTracking, forYear) != null) { throw new MailTrackingDomainException("error.mail.tracking.year.already.created"); } DateTime startDate = new DateTime(forYear, 01, 01, 0, 0, 0, 0); DateTime endDate = new DateTime(forYear, 12, 31, 23, 59, 59, 0); return new Year(mailTracking, forYear.toString(), startDate, endDate); }
From source file:com.evolveum.polygon.test.scim.StandardScimTestUtils.java
protected static Set<Attribute> groupCreateBuilder(Integer testNumber) { StringBuilder testAttributeString = new StringBuilder(); testAttributeString.append(testNumber.toString()).append("Test Group"); Set<Attribute> attributeSet = new HashSet<Attribute>(); attributeSet.add(AttributeBuilder.build(DISPLAYNAME, testAttributeString.toString())); return attributeSet; }
From source file:com.evolveum.polygon.test.scim.StandardScimTestUtils.java
protected static Set<Attribute> groupSingleValUpdateBuilder(Integer testNumber) { Set<Attribute> attributeSet = new HashSet<Attribute>(); StringBuilder buildDisplayName = new StringBuilder(testNumber.toString()).append(" ").append("test"); attributeSet.add(AttributeBuilder.build(DISPLAYNAME, buildDisplayName.toString())); attributeSet.add(AttributeBuilder.build(DISPLAYNAME, buildDisplayName.toString())); return attributeSet; }