package com.wanyue.common.server.entity;

import com.wanyue.common.utils.ListUtil;

import java.util.List;

public class Data<T> {
  private int code;
  private String msg;
  private List<T> info;

    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<T> getInfo() {
        return info;
    }
    public T getInfo_0() {
      return ListUtil.safeGetData(info,0);
    }

    public int size(){
        return info==null?0:info.size();
    }

    public boolean isSucc(){
        return code==0;
    }

    public void setInfo(List<T> info) {
        this.info = info;
    }
}