ErrorResponseData.java 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package com.zhouhong.iotdbdemo.response;
  2. /**
  3. * description: 错误返回封装
  4. * date: 2022/8/15 21:30
  5. * author: zhouhong
  6. */
  7. public class ErrorResponseData extends ResponseData {
  8. private String exceptionClazz;
  9. ErrorResponseData(String message) {
  10. super(false, DEFAULT_ERROR_CODE, message, message, (Object)null);
  11. }
  12. public ErrorResponseData(Integer code, String message) {
  13. super(false, code, message, message, (Object)null);
  14. }
  15. ErrorResponseData(Integer code, String message, Object object) {
  16. super(false, code, message, object);
  17. }
  18. ErrorResponseData(Integer code, String message, String localizedMsg, Object object) {
  19. super(false, code, message, localizedMsg, object);
  20. }
  21. public boolean equals(final Object o) {
  22. if (o == this) {
  23. return true;
  24. } else if (!(o instanceof ErrorResponseData)) {
  25. return false;
  26. } else {
  27. ErrorResponseData other = (ErrorResponseData)o;
  28. if (!other.canEqual(this)) {
  29. return false;
  30. } else if (!super.equals(o)) {
  31. return false;
  32. } else {
  33. Object this$exceptionClazz = this.getExceptionClazz();
  34. Object other$exceptionClazz = other.getExceptionClazz();
  35. if (this$exceptionClazz == null) {
  36. if (other$exceptionClazz != null) {
  37. return false;
  38. }
  39. } else if (!this$exceptionClazz.equals(other$exceptionClazz)) {
  40. return false;
  41. }
  42. return true;
  43. }
  44. }
  45. }
  46. protected boolean canEqual(final Object other) {
  47. return other instanceof ErrorResponseData;
  48. }
  49. public int hashCode() {
  50. int result = super.hashCode();
  51. Object $exceptionClazz = this.getExceptionClazz();
  52. result = result * 59 + ($exceptionClazz == null ? 43 : $exceptionClazz.hashCode());
  53. return result;
  54. }
  55. public String getExceptionClazz() {
  56. return this.exceptionClazz;
  57. }
  58. public void setExceptionClazz(final String exceptionClazz) {
  59. this.exceptionClazz = exceptionClazz;
  60. }
  61. public String toString() {
  62. return "ErrorResponseData(exceptionClazz=" + this.getExceptionClazz() + ")";
  63. }
  64. }