@@ -22,10 +22,6 @@ public Streams getStreams() {
2222 return streams ;
2323 }
2424
25- public Callbacks getCallbacks () {
26- return callbacks ;
27- }
28-
2925 public Object onFailure (Exception e ) {
3026 return callbacks .onFailure .apply (e );
3127 }
@@ -40,7 +36,7 @@ public void setOnFailure(Function<Exception, ?> onFailure) {
4036 */
4137 @ Deprecated
4238 public void setOnFailure (Closure <?> onFailure ) {
43- callbacks . onFailure = onFailure ::call ;
39+ setOnFailure ( onFailure ::call ) ;
4440 }
4541
4642 public Object onResponse (Response r ) {
@@ -57,7 +53,7 @@ public void setOnResponse(Function<Response, ?> onResponse) {
5753 */
5854 @ Deprecated
5955 public void setOnResponse (Closure <?> onResponse ) {
60- callbacks . onResponse = onResponse ::call ;
56+ setOnResponse ( onResponse ::call ) ;
6157 }
6258
6359 public Object onSinkClosed (Response r ) {
@@ -74,7 +70,7 @@ public void setOnSinkClosed(Function<Response, ?> onSinkClosed) {
7470 */
7571 @ Deprecated
7672 public void setOnSinkClosed (Closure <?> onSinkClosed ) {
77- callbacks . onSinkClosed = onSinkClosed ::call ;
73+ setOnSinkClosed ( onSinkClosed ::call ) ;
7874 }
7975
8076 public Object onSinkWritten (Response r ) {
@@ -91,7 +87,7 @@ public void setOnSinkWritten(Function<Response, ?> onSinkWritten) {
9187 */
9288 @ Deprecated
9389 public void setOnSinkWritten (Closure <?> onSinkWritten ) {
94- callbacks . onSinkWritten = onSinkWritten ::call ;
90+ setOnSinkWritten ( onSinkWritten ::call ) ;
9591 }
9692
9793 public Object onSourceConsumed () {
@@ -108,10 +104,10 @@ public void setOnSourceConsumed(Supplier<?> onSourceConsumed) {
108104 */
109105 @ Deprecated
110106 public void setOnSourceConsumed (Closure <?> onSourceConsumed ) {
111- callbacks . onSourceConsumed = () -> {
107+ setOnSourceConsumed ( () -> {
112108 onSourceConsumed .call ();
113109 return null ;
114- };
110+ }) ;
115111 }
116112
117113 public static class Streams {
@@ -158,45 +154,5 @@ public static class Callbacks {
158154 private Function <Response , ?> onSinkClosed = (Response r ) -> null ;
159155 private Function <Response , ?> onSinkWritten = (Response r ) -> null ;
160156 private Supplier <?> onSourceConsumed = () -> null ;
161-
162- public Function <Exception , ?> getOnFailure () {
163- return onFailure ;
164- }
165-
166- public void setOnFailure (Function <Exception , ?> onFailure ) {
167- this .onFailure = onFailure ;
168- }
169-
170- public Function <Response , ?> getOnResponse () {
171- return onResponse ;
172- }
173-
174- public void setOnResponse (Function <Response , ?> onResponse ) {
175- this .onResponse = onResponse ;
176- }
177-
178- public Function <Response , ?> getOnSinkClosed () {
179- return onSinkClosed ;
180- }
181-
182- public void setOnSinkClosed (Function <Response , ?> onSinkClosed ) {
183- this .onSinkClosed = onSinkClosed ;
184- }
185-
186- public Function <Response , ?> getOnSinkWritten () {
187- return onSinkWritten ;
188- }
189-
190- public void setOnSinkWritten (Function <Response , ?> onSinkWritten ) {
191- this .onSinkWritten = onSinkWritten ;
192- }
193-
194- public Supplier <?> getOnSourceConsumed () {
195- return onSourceConsumed ;
196- }
197-
198- public void setOnSourceConsumed (Supplier <?> onSourceConsumed ) {
199- this .onSourceConsumed = onSourceConsumed ;
200- }
201157 }
202158}
0 commit comments