Collection<V> values() //Map類的方法
import org.apache.commons.collections.CollectionUtils; CollectionUtils.addAll(strList, strArray); CollectionUtils.addAll(strSet, strArray); --- List<String> players = Arrays.asList(strArray); //注:此playersList不能add或remove對象,由於大小已由數據決定。
List<String> result = new ArrayList<>(mySet); Set result = new HashSet(myList);
Collection.toArray() /*ArrayList ,EnumSet , HashSet ,LinkedHashSet , LinkedList , Stack , TreeSet , Vector */
String.copyValueOf(charArray) #Array->String
//若是但願獲得YYYYMMDD的格式 SimpleDateFormat sy1=new SimpleDateFormat("yyyyMMDD"); String dateFormat=sy1.format(date); //若是但願分開獲得年,月,日 SimpleDateFormat sy=new SimpleDateFormat("yyyy"); SimpleDateFormat sm=new SimpleDateFormat("MM"); SimpleDateFormat sd=new SimpleDateFormat("dd"); String syear=sy.format(date); String smon=sm.format(date); String sday=sd.format(date); //String -> Date String reportdate_str ="2005-10-01"; reportdate_str = reportdate_str + "00:00:00.0"; Date reportdate = java.sql.Timestamp.valueOf(reportdate_str);
V_DATE = reportdate.toString();
//int Integer.parseInt(String s) int i = Double.intValue(); Character.getNumericValue('a'); //double (new Float(100.00f)).doubleValue(); Double.valueOf("32.1").doubleValue(); Double d = Double.parseDouble( s ); //other byte b = Byte.parseByte( s ); short t = Short.parseShort( s ); long l = Long.parseLong( s ); Float f = Float.parseFloat( s );
Method Summary | - |
---|---|
static void | addBaseClassMappings() |
static void | addClassMapping(String className, Class<?> clazz) |
static
|
cast(Object obj, Class
|
static
|
cast(Object obj, ParameterizedType type, ParserConfig mapping) |
static
|
cast(Object obj, Type type, ParserConfig mapping) |
static BigDecimal | castToBigDecimal(Object value) |
static BigInteger | castToBigInteger(Object value) |
static Boolean | castToBoolean(Object value) |
static Byte | castToByte(Object value) |
static byte[] | castToBytes(Object value) |
static Character | castToChar(Object value) |
static Date | castToDate(Object value) |
static Double | castToDouble(Object value) |
static
|
castToEnum(Object obj, Class
|
static Float | castToFloat(Object value) |
static Integer | castToInt(Object value) |
static
|
castToJavaBean(Map<String,Object> map, Class
|
static
|
castToJavaBean(Object obj, Class
|
static Long | castToLong(Object value) |
static Short | castToShort(Object value) |
static Date | castToSqlDate(Object value) |
static String | castToString(Object value) |
static Timestamp | castToTimestamp(Object value) |
static void | clearClassMapping() |
static List <FieldInfo> | computeGetters(Class<?> clazz, Map<String,String> aliasMap) |
static List <FieldInfo> | computeGetters(Class<?> clazz, Map<String,String> aliasMap, boolean sorted) |
static Class<?> | getClass(Type type) |
static Class<?> | loadClass(String className) |