43 lines
905 B
Java
43 lines
905 B
Java
package org.gcube.app.springbootangulardemo.dto;
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
public class Greeting {
|
|
|
|
|
|
private final long id;
|
|
private final String content;
|
|
|
|
public Greeting(final long id, final String content) {
|
|
this.id = id;
|
|
this.content = content;
|
|
}
|
|
|
|
public long getId() {
|
|
return this.id;
|
|
}
|
|
|
|
public String getContent() {
|
|
return this.content;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(final Object o) {
|
|
if (o == this)
|
|
return true;
|
|
if (!(o instanceof Greeting)) {
|
|
return false;
|
|
}
|
|
final Greeting greeting = (Greeting) o;
|
|
return id == greeting.id && Objects.equals(content, greeting.content);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "{" +
|
|
" id='" + getId() + "'" +
|
|
", content='" + getContent() + "'" +
|
|
"}";
|
|
}
|
|
} |