为了账号安全,请及时绑定邮箱和手机立即绑定

下面Java代码如何用Golang来写?

下面Java代码如何用Golang来写?

时务者 2018-05-19 22:24:50
public class Todo {     private String name;     private Date until;     private String details;     public Todo(String name, String detail, Date until) {         this.name = name;         this.details = detail;         this.until = until;     }     public Todo() {         this.name = "";         this.details = "";         this.until = new Date();     }     public String getName() {         return this.name;     }     public void setName(String name) {         this.name = name;     }     public Date getUntil() {         return this.until;     }     public void setUntil(Date until) {         this.until = until;     }     public String getDetails() {         return this.details;     }     public void setDetails(String details) {         this.details = details;     }     public int hashCode() {         int prime = true;         int result = 1;         int result = 31 * result + (this.details == null ? 0 : this.details.hashCode());         result = 31 * result + (this.name == null ? 0 : this.name.hashCode());         result = 31 * result + (this.until == null ? 0 : this.until.hashCode());         return result;     }     public boolean equals(Object obj) {         if (this == obj) {             return true;         } else if (obj == null) {             return false;         } else if (this.getClass() != obj.getClass()) {             return false;         } else {             Todo other = (Todo)obj;             if (this.details == null) {                 if (other.details != null) {                     return false;                 }             } else if (!this.details.equals(other.details)) {                 return false;             }             if (this.name == null) {                 if (other.name != null) {                     return false;                 }             } else if (!this.name.equals(other.name)) {                 return false;             }             if (this.until == null) {                 if (other.until != null) {                     return false;                 }             } else if (!this.until.equals(other.until)) {                 return false;             }             return true;         }     } }
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 1367 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信