1 21 22 27 28 package javax.mail; 29 30 42 public class Provider { 43 44 49 50 public static class Type { 51 public static final Type STORE = new Type("STORE"); 52 public static final Type TRANSPORT = new Type("TRANSPORT"); 53 54 private String type; 55 56 private Type(String type) { 57 this.type = type; 58 } 59 60 public String toString() { 61 return type; 62 } 63 } 64 65 private Type type; 66 private String protocol, className, vendor, version; 67 68 79 public Provider(Type type, String protocol, String classname, 80 String vendor, String version) { 81 this.type = type; 82 this.protocol = protocol; 83 this.className = classname; 84 this.vendor = vendor; 85 this.version = version; 86 } 87 88 89 public Type getType() { 90 return type; 91 } 92 93 94 public String getProtocol() { 95 return protocol; 96 } 97 98 99 public String getClassName() { 100 return className; 101 } 102 103 104 public String getVendor() { 105 return vendor; 106 } 107 108 109 public String getVersion() { 110 return version; 111 } 112 113 114 public String toString() { 115 String s = "javax.mail.Provider[" + type + "," + 116 protocol + "," + className; 117 118 if (vendor != null) 119 s += "," + vendor; 120 121 if (version != null) 122 s += "," + version; 123 124 s += "]"; 125 return s; 126 } 127 } 128 | Popular Tags |