Skip to content

Commit 258da93

Browse files
committed
MERGE PREP: Rename generic type parameters to align with "master".
1 parent 0315df6 commit 258da93

17 files changed

+104
-91
lines changed

src/main/java/crud/core/ReadableResource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
* A <em>source</em> of data elements of type {@code E}, read by the
2323
* application from somewhere else.
2424
*
25-
* @param <E> The static type of the data elements observable from this
26-
* {@link ReadableResource}.
25+
* @param <RSRC> The static type of the data elements observable from this
26+
* {@link ReadableResource}.
2727
*
2828
* @see WritableResource
2929
*
3030
* @author Rick Warren
3131
*/
32-
public interface ReadableResource<E> extends Resource {
32+
public interface ReadableResource<RSRC> extends Resource {
3333

3434
/**
3535
* Begin observation of the data elements. The {@link Observable} may be
@@ -45,6 +45,6 @@ public interface ReadableResource<E> extends Resource {
4545
* associated with the {@link Session} used to create this
4646
* {@code ReadableResource}.
4747
*/
48-
public Observable<E> read();
48+
public abstract Observable<RSRC> read();
4949

5050
}

src/main/java/crud/core/ReadableResourceSet.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
*
2626
* @author Rick Warren
2727
*/
28-
public interface ReadableResourceSet<K, E> extends ResourceSet<K, E> {
28+
public interface ReadableResourceSet<KEY, RSRC> extends ResourceSet<KEY, RSRC> {
2929

3030
@Override
31-
public @Nonnull Id<K, E> getId();
31+
public abstract @Nonnull Id<KEY, RSRC> getId();
3232

3333
/**
3434
* Return a readable source of those data elements of type {@code E}
@@ -40,23 +40,23 @@ public interface ReadableResourceSet<K, E> extends ResourceSet<K, E> {
4040
* {@link ReadableResourceSet}.
4141
*/
4242
@Override
43-
public @Nonnull ReadableResource<E> get(@Nonnull K key, @Nonnull Session session);
43+
public abstract @Nonnull ReadableResource<RSRC> get(@Nonnull KEY key, @Nonnull Session session);
4444

4545

4646
/**
4747
* Identifies {@link ReadableResourceSet}: a named collection of homogeneously-typed data
4848
* elements in the target middleware. Subsets of these elements are identified
4949
* by keys.
5050
*
51-
* @param <K> The type of the keys.
52-
* @param <E> The type of the data elements, identified by those keys.
51+
* @param <KEY> The type of the keys.
52+
* @param <RSRC> The type of the data elements, identified by those keys.
5353
*/
5454
@Immutable
55-
public static final class Id<K, E> extends ResourceSet.Id<K, E> {
55+
public static final class Id<KEY, RSRC> extends ResourceSet.Id<KEY, RSRC> {
5656
public Id(
5757
@Nonnull final String name,
58-
@Nonnull final Class<K> keyType,
59-
@Nonnull final Class<E> type) {
58+
@Nonnull final Class<KEY> keyType,
59+
@Nonnull final Class<RSRC> type) {
6060
super(name, keyType, type);
6161
}
6262

src/main/java/crud/core/ResourceSet.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525
* table, or a JMS topic (in which every element would be typed by
2626
* {@javax.jms.Message}).
2727
*
28-
* @param <K> The type of the keys.
29-
* @param <E> The type of the data elements, identified by those keys.
28+
* @param <KEY> The type of the keys.
29+
* @param <RSRC> The type of the data elements, identified by those keys.
3030
*
3131
* @author Rick Warren
3232
*/
33-
public interface ResourceSet<K, E> {
33+
public interface ResourceSet<KEY, RSRC> {
3434

3535
/**
3636
* @return An {@link Id} equal to the one provided when this
3737
* {@link ResourceSet} was created.
3838
*/
39-
public @Nonnull Id<K, E> getId();
39+
public abstract @Nonnull Id<KEY, RSRC> getId();
4040

4141
/**
4242
* Return a {@link Resource} identified by the given key, to be accessed
@@ -46,27 +46,27 @@ public interface ResourceSet<K, E> {
4646
* obtained from a {@link DataBus} compatible with this
4747
* {@link WritableResourceSet}.
4848
*/
49-
public @Nonnull Resource get(@Nonnull K key, @Nonnull Session session);
49+
public abstract @Nonnull Resource get(@Nonnull KEY key, @Nonnull Session session);
5050

5151

5252
/**
5353
* Identifies a {@link ResourceSet}: a named collection of homogeneously-typed
5454
* data elements in the target middleware. Subsets of these elements are
5555
* identified by keys.
5656
*
57-
* @param <K> The type of the keys.
58-
* @param <E> The type of the data elements, identified by those keys.
57+
* @param <KEY> The type of the keys.
58+
* @param <RSRC> The type of the data elements, identified by those keys.
5959
*/
6060
@Immutable
61-
public static abstract class Id<K, E> {
61+
public static abstract class Id<KEY, RSRC> {
6262
private @Nonnull final String name;
63-
private @Nonnull final Class<K> keyType;
64-
private @Nonnull final Class<E> elementType;
63+
private @Nonnull final Class<KEY> keyType;
64+
private @Nonnull final Class<RSRC> elementType;
6565

6666
protected Id(
6767
@Nonnull final String name,
68-
@Nonnull final Class<K> keyType,
69-
@Nonnull final Class<E> type) {
68+
@Nonnull final Class<KEY> keyType,
69+
@Nonnull final Class<RSRC> type) {
7070
this.name = Objects.requireNonNull(name);
7171
this.keyType = Objects.requireNonNull(keyType);
7272
this.elementType = Objects.requireNonNull(type);
@@ -76,11 +76,11 @@ protected Id(
7676
return this.name;
7777
}
7878

79-
public final @Nonnull Class<K> getKeyType() {
79+
public final @Nonnull Class<KEY> getKeyType() {
8080
return this.keyType;
8181
}
8282

83-
public final @Nonnull Class<E> getElementType() {
83+
public final @Nonnull Class<RSRC> getElementType() {
8484
return this.elementType;
8585
}
8686

src/main/java/crud/core/WritableResource.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
* A <em>sink</em> for data elements of type {@code E}, written by the
2222
* application to somewhere else.
2323
*
24-
* @param <E> The static type of the data elements written to this
25-
* {@link WritableResource}.
26-
* @param <R> The static type of the result of writing a value.
24+
* @param <RSRC> The static type of the data elements written to this
25+
* {@link WritableResource}.
26+
* @param <RESPONSE> The static type of the result of writing a value.
2727
*
2828
* @see ReadableResource
2929
*
3030
* @author Rick Warren
3131
*/
32-
public interface WritableResource<E, R> extends Resource {
32+
public interface WritableResource<RSRC, RESPONSE> extends Resource {
3333

3434
/**
3535
* Write a single data element to the target middleware. Return to the
@@ -70,6 +70,6 @@ public interface WritableResource<E, R> extends Resource {
7070
* {@link Observable#forEach(rx.functions.Action1) myObservable.forEach(write)}.</li>
7171
* </ol>
7272
*/
73-
public Observable<R> write(E value);
73+
public abstract Observable<RESPONSE> write(RSRC newValue);
7474

7575
}

src/main/java/crud/core/WritableResourceSet.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
*
2828
* @author Rick Warren
2929
*/
30-
public interface WritableResourceSet<K, E, R> extends ResourceSet<K, E> {
30+
public interface WritableResourceSet<KEY, RSRC, RESPONSE> extends ResourceSet<KEY, RSRC> {
3131

3232
@Override
33-
public @Nonnull Id<K, E, R> getId();
33+
public abstract @Nonnull Id<KEY, RSRC, RESPONSE> getId();
3434

3535
/**
3636
* Return a writable destination of those data elements of type {@code E}
@@ -42,34 +42,38 @@ public interface WritableResourceSet<K, E, R> extends ResourceSet<K, E> {
4242
* {@link WritableResourceSet}.
4343
*/
4444
@Override
45-
public @Nonnull WritableResource<E, R> get(@Nonnull K key, @Nonnull Session session);
45+
public abstract @Nonnull WritableResource<RSRC, RESPONSE> get(
46+
@Nonnull KEY key,
47+
@Nonnull Session session);
4648

4749

4850
/**
4951
* Identifies {@link WritableResourceSet}: a named collection of homogeneously-typed data
5052
* elements in the target middleware. Subsets of these elements are identified
5153
* by keys.
5254
*
53-
* @param <K> The type of the keys.
54-
* @param <E> The type of the data elements, identified by those keys.
55-
* @param <R> The type of the results, when new data elements are written.
55+
* @param <KEY> The type of the keys.
56+
* @param <RSRC> The type of the data elements, identified by those
57+
* keys.
58+
* @param <RESPONSE> The type of the results, when new data elements
59+
* are written.
5660
*
5761
* @author Rick Warren
5862
*/
5963
@Immutable
60-
public static final class Id<K, E, R> extends ResourceSet.Id<K, E> {
61-
private @Nonnull final Class<R> writeResultType;
64+
public static final class Id<KEY, RSRC, RESPONSE> extends ResourceSet.Id<KEY, RSRC> {
65+
private @Nonnull final Class<RESPONSE> writeResultType;
6266

6367
public Id(
6468
@Nonnull final String name,
65-
@Nonnull final Class<K> keyType,
66-
@Nonnull final Class<E> elementType,
67-
@Nonnull final Class<R> writeResultType) {
69+
@Nonnull final Class<KEY> keyType,
70+
@Nonnull final Class<RSRC> elementType,
71+
@Nonnull final Class<RESPONSE> writeResultType) {
6872
super(name, keyType, elementType);
6973
this.writeResultType = Objects.requireNonNull(writeResultType);
7074
}
7175

72-
public @Nonnull Class<R> getWriteResultType() {
76+
public @Nonnull Class<RESPONSE> getWriteResultType() {
7377
return this.writeResultType;
7478
}
7579

src/main/java/crud/implementer/AbstractReadableResource.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222
import rx.Subscriber;
2323

2424

25-
public abstract class AbstractReadableResource<E> extends AbstractSessionParticipant implements ReadableResource<E> {
25+
public abstract class AbstractReadableResource<RSRC>
26+
extends AbstractSessionParticipant
27+
implements ReadableResource<RSRC> {
2628

2729
@Override
28-
public Observable<E> read() {
29-
return getWorker().scheduleCold(new SessionWorker.Task<E>() {
30+
public Observable<RSRC> read() {
31+
return getWorker().scheduleCold(new SessionWorker.Task<RSRC>() {
3032
@Override
31-
public void call(final Subscriber<? super E> sub) throws Exception {
33+
public void call(final Subscriber<? super RSRC> sub) throws Exception {
3234
onReadSubscribe(sub);
3335
}
3436
});
@@ -55,7 +57,7 @@ protected AbstractReadableResource(@Nonnull final SessionWorker worker) {
5557
* Exceptions will be passed to
5658
* {@link Observer#onError(Throwable)}.
5759
*/
58-
protected void onReadSubscribe(final Subscriber<? super E> sub) throws Exception {
60+
protected void onReadSubscribe(final Subscriber<? super RSRC> sub) throws Exception {
5961
throw new AssertionError("Must override this method if not overriding read()");
6062
}
6163

src/main/java/crud/implementer/AbstractReadableResourceSet.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
*
2626
* @author Rick Warren
2727
*/
28-
public abstract class AbstractReadableResourceSet<K, E>
29-
extends AbstractResourceSet<K, E>
30-
implements ReadableResourceSet<K, E> {
28+
public abstract class AbstractReadableResourceSet<KEY, RSRC>
29+
extends AbstractResourceSet<KEY, RSRC>
30+
implements ReadableResourceSet<KEY, RSRC> {
3131

3232
@Override
33-
public ReadableResourceSet.Id<K, E> getId() {
34-
return (ReadableResourceSet.Id<K, E>) super.getId();
33+
public ReadableResourceSet.Id<KEY, RSRC> getId() {
34+
return (ReadableResourceSet.Id<KEY, RSRC>) super.getId();
3535
}
3636

37-
protected AbstractReadableResourceSet(@Nonnull final ReadableResourceSet.Id<K, E> id) {
37+
protected AbstractReadableResourceSet(@Nonnull final ReadableResourceSet.Id<KEY, RSRC> id) {
3838
super(id);
3939
}
4040

src/main/java/crud/implementer/AbstractResourceSet.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
*
2828
* @author Rick Warren
2929
*/
30-
public abstract class AbstractResourceSet<K, E> implements ResourceSet<K, E> {
30+
public abstract class AbstractResourceSet<KEY, RSRC> implements ResourceSet<KEY, RSRC> {
3131

32-
private @Nonnull final ResourceSet.Id<K, E> id;
32+
private @Nonnull final ResourceSet.Id<KEY, RSRC> id;
3333

3434

3535
@Override
36-
public ResourceSet.Id<K, E> getId() {
36+
public ResourceSet.Id<KEY, RSRC> getId() {
3737
return this.id;
3838
}
3939

@@ -42,7 +42,7 @@ public String toString() {
4242
return getClass().getSimpleName() + '(' + getId() + ')';
4343
}
4444

45-
protected AbstractResourceSet(@Nonnull final ResourceSet.Id<K, E> id) {
45+
protected AbstractResourceSet(@Nonnull final ResourceSet.Id<KEY, RSRC> id) {
4646
this.id = Objects.requireNonNull(id);
4747
}
4848

src/main/java/crud/implementer/AbstractWritableResource.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
import rx.Subscriber;
2323

2424

25-
public abstract class AbstractWritableResource<E, R>
25+
public abstract class AbstractWritableResource<RSRC, RESPONSE>
2626
extends AbstractSessionParticipant
27-
implements WritableResource<E, R> {
27+
implements WritableResource<RSRC, RESPONSE> {
2828

2929
/**
3030
* Write the given value in the background thread belonging to the
@@ -36,10 +36,10 @@ public abstract class AbstractWritableResource<E, R>
3636
* @see #doWrite(Object, Subscriber)
3737
*/
3838
@Override
39-
public Observable<R> write(final E value) {
40-
return getWorker().scheduleHot(new SessionWorker.Task<R>() {
39+
public Observable<RESPONSE> write(final RSRC value) {
40+
return getWorker().scheduleHot(new SessionWorker.Task<RESPONSE>() {
4141
@Override
42-
public void call(final Subscriber<? super R> sub) throws Exception {
42+
public void call(final Subscriber<? super RESPONSE> sub) throws Exception {
4343
doWrite(value, sub);
4444
}
4545
});
@@ -70,7 +70,8 @@ protected AbstractWritableResource(@Nonnull final SessionWorker worker) {
7070
* Exceptions will be passed to
7171
* {@link Observer#onError(Throwable)}.
7272
*/
73-
protected void doWrite(final E writeMe, final Subscriber<? super R> resultSub) throws Exception {
73+
protected void doWrite(final RSRC writeMe, final Subscriber<? super RESPONSE> resultSub)
74+
throws Exception {
7475
throw new AssertionError("Must override this method if not overriding write()");
7576
}
7677

src/main/java/crud/implementer/AbstractWritableResourceSet.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
*
2626
* @author Rick Warren
2727
*/
28-
public abstract class AbstractWritableResourceSet<K, E, R>
29-
extends AbstractResourceSet<K, E>
30-
implements WritableResourceSet<K, E, R> {
28+
public abstract class AbstractWritableResourceSet<KEY, RSRC, RESPONSE>
29+
extends AbstractResourceSet<KEY, RSRC>
30+
implements WritableResourceSet<KEY, RSRC, RESPONSE> {
3131

3232
@Override
3333
@SuppressWarnings("unchecked")
34-
public WritableResourceSet.Id<K, E, R> getId() {
35-
return (WritableResourceSet.Id<K, E, R>) super.getId();
34+
public WritableResourceSet.Id<KEY, RSRC, RESPONSE> getId() {
35+
return (WritableResourceSet.Id<KEY, RSRC, RESPONSE>) super.getId();
3636
}
3737

38-
protected AbstractWritableResourceSet(@Nonnull final WritableResourceSet.Id<K, E, R> id) {
38+
protected AbstractWritableResourceSet(@Nonnull final WritableResourceSet.Id<KEY, RSRC, RESPONSE> id) {
3939
super(id);
4040
}
4141

0 commit comments

Comments
 (0)