Package com.iisigroup.cap.model

Examples of com.iisigroup.cap.model.GenericBean


  @SuppressWarnings("unchecked")
  @Override
  public String reformat(Object in) {
    Timestamp start = null, end = null;
    if (in instanceof GenericBean) {
      GenericBean bean = (GenericBean) in;
      start = (Timestamp) bean.get(startCol);
      end = (Timestamp) bean.get(endCol);
    } else if (in instanceof Map) {
      Map<String, Object> map = (Map<String, Object>) in;
      start = (Timestamp) map.get(startCol);
      end = (Timestamp) map.get(endCol);
    }
View Full Code Here


   * @throws CapException
   */
  public static <T extends GenericBean> T copyBean(T source, T destination,
      String[] columns) {
    if (source instanceof GenericBean && destination instanceof GenericBean) {
      GenericBean s = (GenericBean) source;
      GenericBean d = (GenericBean) destination;
      for (String col : columns) {
        if (!CapString.isEmpty(col)) {
          d.set(col, s.get(col));
        }
      }
    }
    return destination;
  }// ;
View Full Code Here

   * @throws CapException
   */
  public static <T extends GenericBean> Map<String, Object> bean2Map(
      T source, String[] columns, String fixString, boolean isPrefix) {
    Map<String, Object> map = new LinkedHashMap<String, Object>();
    GenericBean s = (GenericBean) source;
    for (String col : columns) {
      String key = (fixString == null) ? col : (isPrefix) ? fixString
          + col : col + fixString;
      map.put(key, s.get(col));
    }
    return map;
  }// ;
View Full Code Here

TOP

Related Classes of com.iisigroup.cap.model.GenericBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.