com.greenline.guahao.biz.manager.partners.xm.dataobject.XmResponseDO.java Source code

Java tutorial

Introduction

Here is the source code for com.greenline.guahao.biz.manager.partners.xm.dataobject.XmResponseDO.java

Source

/*
 * Project: guahao-portal-biz-core
 * 
 * File Created at 2014-4-8
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package com.greenline.guahao.biz.manager.partners.xm.dataobject;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

import org.apache.commons.lang.StringUtils;

/**
 * @Type XmResponseDO
 * @Desc ???
 * @author alex
 * @date 2014-4-8
 * @Version V1.0
 */
public class XmResponseDO implements Serializable {
    private static final long serialVersionUID = -3526621855448205572L;
    /**
     * ??
     */
    private String userId;
    /**
     * ?state?
     */
    private String state;
    /**
     * ?
     */
    private String error;
    /**
     * ??
     */
    private String error_description;
    /**
     * 
     */
    private String access_token;
    /**
     * ??
     */
    private String expires_in;
    /**
     * 
     */
    private Date accessTokenEndTime;
    /**
     * ??10
     */
    private String refresh_token;
    /**
     * ??
     */
    private String scope;
    /**
     * 
     */
    private String token_type;
    /**
     * mac
     */
    private String mac_key;
    /**
     * mac
     */
    private String mac_algorithm;
    /**
     * ?ok  error
     */
    private String result;
    /**
     * ???
     */
    private String description;
    /**
     * ????  ??0 ????
     */
    private String code;
    /**
     * ??
     */
    private Data data;

    /**
     * api??
     * @return
     */
    public boolean callApiOk() {
        return StringUtils.isNotBlank(result) && "ok".equalsIgnoreCase(result);
    }

    /**
     * ?
     * @return
     */
    public Date countAccessTokenEndTime() {
        Calendar c = Calendar.getInstance();
        c.add(Calendar.SECOND, Integer.valueOf(expires_in));
        accessTokenEndTime = c.getTime();
        return accessTokenEndTime;
    }

    public static class Data {
        /**
         * 
         */
        public String miliaoNick;
        /**
         * ??
         */
        public String aliasNick;
        /**
         * ?
         */
        public String userId;
        /**
         * ?
         */
        public String miliaoIcon;
        /**
         * ??
         */
        public String phone;

        public String getMiliaoNick() {
            return miliaoNick;
        }

        public void setMiliaoNick(String miliaoNick) {
            this.miliaoNick = miliaoNick;
        }

        public String getUserId() {
            return userId;
        }

        public void setUserId(String userId) {
            this.userId = userId;
        }

        public String getMiliaoIcon() {
            return miliaoIcon;
        }

        public void setMiliaoIcon(String miliaoIcon) {
            this.miliaoIcon = miliaoIcon;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public String getAliasNick() {
            return aliasNick;
        }

        public void setAliasNick(String aliasNick) {
            this.aliasNick = aliasNick;
        }

    }

    public Date getAccessTokenEndTime() {
        return accessTokenEndTime;
    }

    public void setAccessTokenEndTime(Date accessTokenEndTime) {
        this.accessTokenEndTime = accessTokenEndTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public String getError_description() {
        return error_description;
    }

    public void setError_description(String error_description) {
        this.error_description = error_description;
    }

    public String getAccess_token() {
        return access_token;
    }

    public void setAccess_token(String access_token) {
        this.access_token = access_token;
    }

    public String getExpires_in() {
        return expires_in;
    }

    public void setExpires_in(String expires_in) {
        this.expires_in = expires_in;
        countAccessTokenEndTime();
    }

    public String getRefresh_token() {
        return refresh_token;
    }

    public void setRefresh_token(String refresh_token) {
        this.refresh_token = refresh_token;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getToken_type() {
        return token_type;
    }

    public void setToken_type(String token_type) {
        this.token_type = token_type;
    }

    public String getMac_key() {
        return mac_key;
    }

    public void setMac_key(String mac_key) {
        this.mac_key = mac_key;
    }

    public String getMac_algorithm() {
        return mac_algorithm;
    }

    public void setMac_algorithm(String mac_algorithm) {
        this.mac_algorithm = mac_algorithm;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Data getData() {
        return data;
    }

    public void setData(Data data) {
        this.data = data;
    }

}