22
22
23
23
24
24
/**
25
- * A set of fluent transformations on {@link WritableResource}s.
25
+ * A set of transformations on {@link WritableResource}s.
26
26
*/
27
- public abstract class FluentWritableResource <RSRC , RESPONSE > implements WritableResource <RSRC , RESPONSE > {
27
+ public abstract class TransformedWritableResource <RSRC , RESPONSE > implements WritableResource <RSRC , RESPONSE > {
28
28
29
29
/**
30
- * If the given resource is a {@code FluentWritableResource }, return it.
30
+ * If the given resource is a {@code TransformedWritableResource }, return it.
31
31
* Otherwise, wrap it in a new instance.
32
32
*/
33
- public static <RSRC , RESPONSE > FluentWritableResource <RSRC , RESPONSE > from (
33
+ public static <RSRC , RESPONSE > TransformedWritableResource <RSRC , RESPONSE > from (
34
34
final WritableResource <RSRC , RESPONSE > resource ) {
35
- if (resource instanceof FluentWritableResource <?, ?>) {
36
- return (FluentWritableResource <RSRC , RESPONSE >) resource ;
35
+ if (resource instanceof TransformedWritableResource <?, ?>) {
36
+ return (TransformedWritableResource <RSRC , RESPONSE >) resource ;
37
37
} else {
38
38
return new DelegatingWritableResource <>(resource );
39
39
}
@@ -43,13 +43,13 @@ public static <RSRC, RESPONSE> FluentWritableResource<RSRC, RESPONSE> from(
43
43
* Create and return a new resource that will transform the responses from
44
44
* this resource.
45
45
*
46
- * If this method is called on two equal {@code FluentWritableResource }s,
46
+ * If this method is called on two equal {@code TransformedWritableResource }s,
47
47
* the results will be equal if the functions are equal. If equality
48
48
* behavior it important to you (for example, if you intend to keep
49
49
* resources in a {@code HashSet}), consider it in your function
50
50
* implementation.
51
51
*/
52
- public <TO > FluentWritableResource <RSRC , TO > mapResponse (
52
+ public <TO > TransformedWritableResource <RSRC , TO > mapResponse (
53
53
final Func1 <? super Observable <RESPONSE >, ? extends Observable <TO >> mapper ) {
54
54
return new MappingWritableResource <>(this , mapper );
55
55
}
@@ -58,13 +58,13 @@ public <TO> FluentWritableResource<RSRC, TO> mapResponse(
58
58
* Create and return a new resource that will transform the input resource
59
59
* states before passing them to this resource.
60
60
*
61
- * If this method is called on two equal {@code FluentWritableResource }s,
61
+ * If this method is called on two equal {@code TransformedWritableResource }s,
62
62
* the results will be equal if the functions are equal. If equality
63
63
* behavior it important to you (for example, if you intend to keep
64
64
* resources in a {@code HashSet}), consider it in your function
65
65
* implementation.
66
66
*/
67
- public <TO > FluentWritableResource <TO , RESPONSE > adaptNewValue (
67
+ public <TO > TransformedWritableResource <TO , RESPONSE > adaptNewValue (
68
68
final Func1 <? super TO , ? extends RSRC > adapter ) {
69
69
return new AdaptingWritableResource <>(this , adapter );
70
70
}
@@ -79,7 +79,7 @@ public Func1<RSRC, Observable<RESPONSE>> toFunction() {
79
79
return new DelegateObjectMethods .Function <RSRC , Observable <RESPONSE >>(this ) {
80
80
@ Override
81
81
public Observable <RESPONSE > call (final RSRC newValue ) {
82
- return FluentWritableResource .this .write (newValue );
82
+ return TransformedWritableResource .this .write (newValue );
83
83
}
84
84
};
85
85
}
@@ -90,14 +90,14 @@ public Observable<RESPONSE> call(final RSRC newValue) {
90
90
* combined with its parent class, because it needs additional type
91
91
* parameters that should not be public.
92
92
*/
93
- private static abstract class AbstractFluentWritableResource <FROMRS , TORS , FROMRP , TORP , T >
94
- extends FluentWritableResource <TORS , TORP > {
95
- protected final FluentResourceStateMixin <WritableResource <FROMRS , FROMRP >, T > state ;
93
+ private static abstract class AbstractTransformedWritableResource <FROMRS , TORS , FROMRP , TORP , T >
94
+ extends TransformedWritableResource <TORS , TORP > {
95
+ protected final TransformedResourceStateMixin <WritableResource <FROMRS , FROMRP >, T > state ;
96
96
97
- protected AbstractFluentWritableResource (
97
+ protected AbstractTransformedWritableResource (
98
98
final WritableResource <FROMRS , FROMRP > delegate ,
99
99
final T auxiliary ) {
100
- this .state = new FluentResourceStateMixin <>(delegate , auxiliary );
100
+ this .state = new TransformedResourceStateMixin <>(delegate , auxiliary );
101
101
}
102
102
103
103
@ Override
@@ -111,7 +111,7 @@ public boolean equals(final Object obj) {
111
111
if (getClass () != obj .getClass ()) {
112
112
return false ;
113
113
}
114
- final AbstractFluentWritableResource <?, ?, ?, ?, ?> other = (AbstractFluentWritableResource <?, ?, ?, ?, ?>) obj ;
114
+ final AbstractTransformedWritableResource <?, ?, ?, ?, ?> other = (AbstractTransformedWritableResource <?, ?, ?, ?, ?>) obj ;
115
115
return this .state .equals (other .state );
116
116
}
117
117
@@ -123,7 +123,7 @@ public int hashCode() {
123
123
124
124
125
125
private static final class DelegatingWritableResource <RSRC , RESPONSE >
126
- extends AbstractFluentWritableResource <RSRC , RSRC , RESPONSE , RESPONSE , Void > {
126
+ extends AbstractTransformedWritableResource <RSRC , RSRC , RESPONSE , RESPONSE , Void > {
127
127
public DelegatingWritableResource (final WritableResource <RSRC , RESPONSE > delegate ) {
128
128
super (delegate , null );
129
129
}
@@ -138,7 +138,7 @@ public Observable<RESPONSE> write(final RSRC newValue) {
138
138
139
139
140
140
private static final class MappingWritableResource <RSRC , FROM , TO >
141
- extends AbstractFluentWritableResource <RSRC , RSRC , FROM , TO , Func1 <? super Observable <FROM >, ? extends Observable <TO >>> {
141
+ extends AbstractTransformedWritableResource <RSRC , RSRC , FROM , TO , Func1 <? super Observable <FROM >, ? extends Observable <TO >>> {
142
142
public MappingWritableResource (
143
143
final WritableResource <RSRC , FROM > delegate ,
144
144
final Func1 <? super Observable <FROM >, ? extends Observable <TO >> mapper ) {
@@ -156,7 +156,7 @@ public Observable<TO> write(final RSRC value) {
156
156
157
157
158
158
private static final class AdaptingWritableResource <FROM , TO , RESPONSE >
159
- extends AbstractFluentWritableResource <FROM , TO , RESPONSE , RESPONSE , Func1 <? super TO , ? extends FROM >> {
159
+ extends AbstractTransformedWritableResource <FROM , TO , RESPONSE , RESPONSE , Func1 <? super TO , ? extends FROM >> {
160
160
private AdaptingWritableResource (
161
161
final WritableResource <FROM , RESPONSE > delegate ,
162
162
final Func1 <? super TO , ? extends FROM > adapter ) {
0 commit comments