Commit 82fe751d by pye52

Merge branch 'develop'

parents 82fbbeb1 cebb9970
package com.bgycc.smartcanteen.entity;
import java.util.Objects;
public class CommandResponse {
private boolean success;
private String message;
private CommandResponse(boolean success, String message) {
this.success = success;
this.message = message;
}
public static CommandResponse failed(String reason) {
return new CommandResponse(false, reason);
}
public static CommandResponse success(String reason) {
return new CommandResponse(true, reason);
}
public boolean success() {
return success;
}
public String getMessage() {
return message;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CommandResponse that = (CommandResponse) o;
return success == that.success &&
Objects.equals(message, that.message);
}
@Override
public int hashCode() {
return Objects.hash(success, message);
}
@Override
public String toString() {
return "CommandResponse{" +
"success=" + success +
", message='" + message + '\'' +
'}';
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment