Пример #1
0
 /**
  * 以Timestamp类型返回键值
  *
  * @param key 键名
  * @return Timestamp 键值
  */
 public Timestamp getAsTimestamp(String key) {
   Object obj = TypeCaseHelper.convert(get(key), "Timestamp", "yyyy-MM-dd HH:mm:ss");
   if (obj != null) return (Timestamp) obj;
   else return null;
 }
Пример #2
0
 /**
  * 以Boolean类型返回键值
  *
  * @param key 键名
  * @return Timestamp 键值
  */
 public Boolean getAsBoolean(String key) {
   Object obj = TypeCaseHelper.convert(get(key), "Boolean", null);
   if (obj != null) return (Boolean) obj;
   else return null;
 }
Пример #3
0
 /**
  * 以String类型返回键值
  *
  * @param key 键名
  * @return String 键值
  */
 public String getAsString(String key) {
   Object obj = TypeCaseHelper.convert(get(key), "String", null);
   if (obj != null) return (String) obj;
   else return "";
 }
Пример #4
0
 /**
  * 以Long类型返回键值
  *
  * @param key 键名
  * @return Long 键值
  */
 public Long getAsLong(String key) {
   Object obj = TypeCaseHelper.convert(get(key), "Long", null);
   if (obj != null) return (Long) obj;
   else return null;
 }
Пример #5
0
 /**
  * 以Integer类型返回键值
  *
  * @param key 键名
  * @return Integer 键值
  */
 public Integer getAsInteger(String key) {
   Object obj = TypeCaseHelper.convert(get(key), "Integer", null);
   if (obj != null) return (Integer) obj;
   else return null;
 }
Пример #6
0
 /**
  * 以Date类型返回键值
  *
  * @param key 键名
  * @return Date 键值
  */
 public Date getAsDate(String key) {
   Object obj = TypeCaseHelper.convert(get(key), "Date", "yyyy-MM-dd");
   if (obj != null) return (Date) obj;
   else return null;
 }
Пример #7
0
 /**
  * 以BigDecimal类型返回键值
  *
  * @param key 键名
  * @return BigDecimal 键值
  */
 public BigDecimal getAsBigDecimal(String key) {
   Object obj = TypeCaseHelper.convert(get(key), "BigDecimal", null);
   if (obj != null) return (BigDecimal) obj;
   else return null;
 }