golang生成java代码_下面Java代码如何用Golang来写?

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;

}

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值