首页 > 编程知识 正文

java方法返回值返回给谁,java实体类转json

时间:2023-05-03 21:28:27 阅读:134764 作者:2570

公共类响应消息{

privatefinalstaticstringstatus _ ok='0';

privatefinalstaticstringstatus _ error='1';

私有字符串状态; //状态

私有对象数据; //返回值

private Exception e; //异常捕获

private薄大衣; //个性化奋斗大厦

公共字符串获取状态

返回状态;

}

公共语音集状态(string status )。

this.status=status;

}

公共对象获取数据

返回数据;

}

公共void setdata (objectdata ) {

this.data=data;

}

公共扩展获取

返回e;

}

公共void sete (exception e ) {

this.e=e;

}

公共字符串获取(

return msg;

}

薄外套)。

this.msg=msg;

}

公共响应消息

super (;

}

publicresponsemessage (string status,Object data,Exception e,轻薄外套) {

super (;

this.status=status;

this.data=data;

this.e=e;

this.msg=msg;

}

//*

publicstaticresponsemessagenewokinstance (objectdata,轻薄外套) {

returnnewresponsemessage (response message.status _ ok,data,null,msg );

}

//*

publicresponsemessagenewokinstance {

returnnewresponsemessage (response message.status _ ok,data,null,null );

}

//*

publicstaticresponsemessagenewerrorinstance {

returnnewresponsemessage (response message.status _ error,null,null,msg );

}

//*

publicstaticresponsemessagenewerrorinstance {

returnnewresponsemessage (response message.status _ error,null,e,msg );

}

}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。