1 36 package org.columba.ristretto.smtp; 37 38 39 47 public class SMTPResponse { 48 49 private int code; 50 private String message; 51 private String domain; 52 private boolean hasSuccessor; 53 54 61 public SMTPResponse(int code, boolean hasSuccessor, String message) { 62 this.code = code; 63 this.message = message; 64 this.hasSuccessor = hasSuccessor; 65 } 66 67 75 public SMTPResponse(int code, boolean hasSuccessor, String message, String domain) { 76 this.code = code; 77 this.message = message; 78 this.hasSuccessor = hasSuccessor; 79 this.domain = domain; 80 } 81 82 85 public int getCode() { 86 return code; 87 } 88 89 92 public void setCode(int code) { 93 this.code = code; 94 } 95 96 99 public String getMessage() { 100 return message; 101 } 102 103 106 public void setMessage(String message) { 107 this.message = message; 108 } 109 110 113 public String getDomain() { 114 return domain; 115 } 116 117 120 public void setDomain(String domain) { 121 this.domain = domain; 122 } 123 124 127 public boolean isHasSuccessor() { 128 return hasSuccessor; 129 } 130 131 134 public void setHasSuccessor(boolean hasSuccessor) { 135 this.hasSuccessor = hasSuccessor; 136 } 137 138 139 145 public boolean isERR() { 146 return code >= 400; 147 } 148 149 155 public boolean isOK() { 156 return code < 400; 157 } 158 } 159 | Popular Tags |