11package cn .jpush .api .common ;
22
33import java .util .HashMap ;
4- import java .util .Map ;
54
65public class ClientConfig extends HashMap <String , Object > {
76
@@ -117,80 +116,48 @@ public static ClientConfig getInstance() {
117116 return instance ;
118117 }
119118
120- public static void setDeviceHostName (Map conf , String hostName ) {
121- conf .put (DEVICE_HOST_NAME , hostName );
122- }
123-
124119 /**
125120 * Setup custom device api host name, if using the JPush privacy cloud.
126121 * @param hostName the custom api host name, default is JPush domain name
127122 */
128123 public void setDeviceHostName (String hostName ) {
129- setDeviceHostName (this , hostName );
130- }
131-
132- public static void setPushHostName (Map conf , String hostName ) {
133- conf .put (PUSH_HOST_NAME , hostName );
124+ this .put (DEVICE_HOST_NAME , hostName );
134125 }
135126
136127 /**
137128 * Setup custom push api host name, if using the JPush privacy cloud.
138129 * @param hostName the custom api host name, default is JPush domain name
139130 */
140131 public void setPushHostName (String hostName ) {
141- setPushHostName (this , hostName );
142- }
143-
144- public static void setReportHostName (Map conf , String hostName ) {
145- conf .put (REPORT_HOST_NAME , hostName );
132+ this .put (PUSH_HOST_NAME , hostName );
146133 }
147134
148135 /**
149136 * Setup custom report api host name, if using the JPush privacy cloud.
150137 * @param hostName the custom api host name, default is JPush domain name
151138 */
152139 public void setReportHostName (String hostName ) {
153- setReportHostName (this , hostName );
154- }
155-
156- public static void setScheduleHostName (Map conf , String hostName ) {
157- conf .put (SCHEDULE_HOST_NAME , hostName );
140+ this .put (REPORT_HOST_NAME , hostName );
158141 }
159142
160143 public void setScheduleHostName (String hostName ) {
161- setScheduleHostName ( this , hostName );
144+ this . put ( SCHEDULE_HOST_NAME , hostName );
162145 }
163146
164147 public void setSSLVersion (String sslVer ) {
165- setSSLVersion (this , sslVer );
166- }
167-
168- public static void setSSLVersion (Map conf , String sslVer ) {
169- conf .put (SSL_VERSION , sslVer );
148+ this .put (SSL_VERSION , sslVer );
170149 }
171150
172151 public void setMaxRetryTimes (int maxRetryTimes ) {
173- setMaxRetryTimes (this , maxRetryTimes );
174- }
175-
176- public static void setMaxRetryTimes (Map conf , int maxRetryTimes ) {
177- conf .put (MAX_RETRY_TIMES , maxRetryTimes );
152+ this .put (MAX_RETRY_TIMES , maxRetryTimes );
178153 }
179154
180155 public void setReadTimeout (int readTimeout ) {
181- setReadTimeout (this , readTimeout );
182- }
183-
184- public static void setReadTimeout (Map conf , int readTimeout ) {
185- conf .put (READ_TIMEOUT , readTimeout );
156+ this .put (READ_TIMEOUT , readTimeout );
186157 }
187158
188159 public void setConnectionTimeout (int connectionTimeout ) {
189- setConnectionTimeout (this , connectionTimeout );
190- }
191-
192- public static void setConnectionTimeout (Map conf , int connectionTimeout ) {
193- conf .put (CONNECTION_TIMEOUT , connectionTimeout );
160+ this .put (CONNECTION_TIMEOUT , connectionTimeout );
194161 }
195162
196163 public String getSSLVersion () {
@@ -209,28 +176,20 @@ public Integer getConnectionTimeout() {
209176 return (Integer ) this .get (CONNECTION_TIMEOUT );
210177 }
211178
212- public static void setApnsProduction (Map conf , boolean production ) {
179+ public void setApnsProduction (boolean production ) {
213180 if (production ) {
214- conf .put (APNS_PRODUCTION , 1 );
181+ this .put (APNS_PRODUCTION , 1 );
215182 } else {
216- conf .put (APNS_PRODUCTION , 0 );
183+ this .put (APNS_PRODUCTION , 0 );
217184 }
218185 }
219186
220- public void setApnsProduction (boolean production ) {
221- setApnsProduction (this , production );
222- }
223-
224- public static void setTimeToLive (Map conf , long timeToLive ) {
225- conf .put (TIME_TO_LIVE , timeToLive );
226- }
227-
228187 public void setTimeToLive (long timeToLive ) {
229- setTimeToLive ( this , timeToLive );
188+ this . put ( TIME_TO_LIVE , timeToLive );
230189 }
231190
232191 public void setGlobalPushSetting (boolean apnsProduction , long timeToLive ) {
233- setApnsProduction (this , apnsProduction );
192+ setApnsProduction (apnsProduction );
234193 setTimeToLive (timeToLive );
235194 }
236195}
0 commit comments