File tree Expand file tree Collapse file tree 3 files changed +20
-13
lines changed
src/main/java/org/javawebstack/httpclient Expand file tree Collapse file tree 3 files changed +20
-13
lines changed Original file line number Diff line number Diff line change 77 <properties >
88 <maven .compiler.source>8</maven .compiler.source>
99 <maven .compiler.target>8</maven .compiler.target>
10- <buildVersion >1.0.1 -SNAPSHOT</buildVersion >
10+ <buildVersion >1.0.2 -SNAPSHOT</buildVersion >
1111 </properties >
1212
1313 <groupId >org.javawebstack</groupId >
4646 <url >https://github.com/JavaWebStack/http-client/tree/master</url >
4747 </scm >
4848
49+ <repositories >
50+ <repository >
51+ <id >ossrh-snapshots</id >
52+ <url >https://s01.oss.sonatype.org/content/repositories/snapshots/</url >
53+ </repository >
54+ </repositories >
55+
4956 <dependencies >
5057 <dependency >
5158 <groupId >org.javawebstack</groupId >
5259 <artifactId >abstract-data</artifactId >
53- <version >1.0.4 </version >
60+ <version >1.0.7-SNAPSHOT </version >
5461 </dependency >
5562 <dependency >
5663 <groupId >org.junit.jupiter</groupId >
Original file line number Diff line number Diff line change 11package org .javawebstack .httpclient ;
22
3- import org .javawebstack .abstractdata .AbstractMapper ;
4- import org .javawebstack .abstractdata .NamingPolicy ;
3+ import org .javawebstack .abstractdata .mapper . Mapper ;
4+ import org .javawebstack .abstractdata .mapper . naming . NamingPolicy ;
55import org .javawebstack .httpclient .implementation .IHTTPRequestImplementation ;
66import org .javawebstack .httpclient .implementation .JavaNetHTTPRequestImplementation ;
77import org .javawebstack .httpclient .interceptor .RequestInterceptor ;
1616
1717public class HTTPClient {
1818
19- private AbstractMapper abstractMapper = new AbstractMapper ()
20- .setNamingPolicy (NamingPolicy .SNAKE_CASE );
19+ private Mapper mapper = new Mapper ()
20+ .namingPolicy (NamingPolicy .SNAKE_CASE );
2121 private int timeout = 5000 ;
2222 private String baseUrl ;
2323 private Map <String , String []> defaultHeaders = new HashMap <>();
@@ -79,13 +79,13 @@ public boolean isSSLVerification() {
7979 return this .sslVerification ;
8080 }
8181
82- public HTTPClient abstractMapper ( AbstractMapper mapper ) {
83- this .abstractMapper = mapper ;
82+ public HTTPClient mapper ( Mapper mapper ) {
83+ this .mapper = mapper ;
8484 return this ;
8585 }
8686
87- public AbstractMapper getAbstractMapper () {
88- return abstractMapper ;
87+ public Mapper getMapper () {
88+ return mapper ;
8989 }
9090
9191 public HTTPClient timeout (int timeout ) {
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ public HTTPRequest formBody(Object object) {
111111 return formBodyString ((QueryString ) object );
112112 if (object instanceof AbstractElement )
113113 return formBodyElement ((AbstractElement ) object );
114- return formBodyElement (client .getAbstractMapper ().toAbstract (object ));
114+ return formBodyElement (client .getMapper ().map (object ));
115115 }
116116
117117 public HTTPRequest formBodyElement (AbstractElement element ) {
@@ -129,7 +129,7 @@ public HTTPRequest tokenAuth(String token) {
129129 public HTTPRequest jsonBody (Object object ) {
130130 if (object instanceof AbstractElement )
131131 return jsonBodyElement ((AbstractElement ) object );
132- return jsonBodyElement (client .getAbstractMapper ().toAbstract (object ));
132+ return jsonBodyElement (client .getMapper ().map (object ));
133133 }
134134
135135 public Map <String , String []> headers () {
@@ -170,7 +170,7 @@ public <T> T object(Class<T> type) {
170170 return (T ) responseBody ;
171171 if (type .equals (String .class ))
172172 return (T ) string ();
173- return client .getAbstractMapper ().fromAbstract (data (), type );
173+ return client .getMapper ().map (data (), type );
174174 }
175175
176176 public AbstractElement data () {
You can’t perform that action at this time.
0 commit comments