Package net.bnubot.webbot.server

Source Code of net.bnubot.webbot.server.BeanUtils

/**
* This file is distributed under the GPL
* $Id: BeanUtils.java 1529 2008-06-01 06:14:44Z scotta $
*/

package net.bnubot.webbot.server;

import java.text.DateFormat;
import java.util.Date;

import net.bnubot.util.BNetUser;
import net.bnubot.webbot.client.types.BeanBNetUser;
import net.bnubot.webbot.client.types.BeanDate;

public class BeanUtils {

  public static BeanDate beanDate() {
    return beanDate(new Date());
  }

  private static BeanDate beanDate(Date date) {
    BeanDate bd = new BeanDate();
    bd.time = date.getTime();
    bd.string = DateFormat.getTimeInstance().format(date);
    return bd;
  }

  public static BeanBNetUser beanBNetUser(BNetUser user) {
    BeanBNetUser bbnu = new BeanBNetUser();
    bbnu.display = user.toString();
    bbnu.flags = user.getFlags();
    return bbnu;
  }

}
TOP

Related Classes of net.bnubot.webbot.server.BeanUtils

TOP
Copyright © 2018 www.massapi.com. 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.