1 package org
.apache
.james
.mime4j
;
4 * Enumerates events which can be monitored.
6 public final class Event
{
8 /** Indicates that a body part ended prematurely. */
9 public static final Event MIME_BODY_PREMATURE_END
10 = new Event("Body part ended prematurely. " +
11 "Boundary detected in header or EOF reached.");
12 /** Indicates that unexpected end of headers detected.*/
13 public static final Event HEADERS_PREMATURE_END
14 = new Event("Unexpected end of headers detected. " +
15 "Higher level boundary detected or EOF reached.");
16 /** Indicates that unexpected end of headers detected.*/
17 public static final Event INALID_HEADER
18 = new Event("Invalid header encountered");
20 private final String code
;
22 public Event(final String code
) {
25 throw new IllegalArgumentException("Code may not be null");
30 public int hashCode() {
31 return code
.hashCode();
34 public boolean equals(Object obj
) {
35 if (obj
== null) return false;
36 if (this == obj
) return true;
37 if (obj
instanceof Event
) {
38 Event that
= (Event
) obj
;
39 return this.code
.equals(that
.code
);
45 public String
toString() {