Skip to content

Commit

Permalink
Changed visibility of ISubscription methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
tbressler committed Dec 28, 2017
1 parent f60e1bd commit 5ead7b4
Show file tree
Hide file tree
Showing 20 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'de.tbressler.waterrower'
version '0.9.7'
version '0.9.8'

apply plugin: 'java'
apply plugin: 'maven'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class AbstractMemorySubscription implements ISubscription {
* @param memory Single, double or triple memory. Must not be null.
* @param location The memory location, must not be null.
*/
AbstractMemorySubscription(Memory memory, MemoryLocation location) {
public AbstractMemorySubscription(Memory memory, MemoryLocation location) {
this.memory = requireNonNull(memory);
this.location = requireNonNull(location);
}
Expand Down Expand Up @@ -64,6 +64,6 @@ public final void handle(AbstractMessage msg) {
*
* @param msg The message, never null.
*/
abstract void handle(DataMemoryMessage msg);
abstract protected void handle(DataMemoryMessage msg);

}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ protected final void handle(DataMemoryMessage msg) {
*
* @param averageStrokeTime The new average stroke time.
*/
protected abstract void onAverageStrokeTimeUpdated(int averageStrokeTime);
abstract protected void onAverageStrokeTimeUpdated(int averageStrokeTime);

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ protected final void handle(DataMemoryMessage msg) {
*
* @param duration The new clock count-down, never null.
*/
protected abstract void onClockCountDownUpdated(Duration duration);
abstract protected void onClockCountDownUpdated(Duration duration);

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ protected final void handle(DataMemoryMessage msg) {
*
* @param duration The new duration, never null.
*/
protected abstract void onDurationUpdated(Duration duration);
abstract protected void onDurationUpdated(Duration duration);

}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ protected final void handle(DataMemoryMessage msg) {
* @param mode The distance mode (e.g. total distance or displayed distance), never null.
* @param distance The new distance.
*/
protected abstract void onDistanceUpdated(DistanceMode mode, int distance);
abstract protected void onDistanceUpdated(DistanceMode mode, int distance);

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private static MemoryLocation getMemoryLocation(IntensityType intensityType) {


@Override
void handle(DataMemoryMessage msg) {
protected void handle(DataMemoryMessage msg) {
int intensity = intFromHighAndLow(msg.getValue2(), msg.getValue1());

// If the received intensity is the same as before,
Expand All @@ -83,6 +83,6 @@ void handle(DataMemoryMessage msg) {
* @param intensityType The intensity type, never null.
* @param intensity The new value.
*/
abstract void onIntensityUpdated(IntensityType intensityType, int intensity);
abstract protected void onIntensityUpdated(IntensityType intensityType, int intensity);

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public final void handle(AbstractMessage msg) {
*
* @param pulsesCount The number of pulse’s counted during the last 25mS period.
*/
abstract void onPulseCount(int pulsesCount);
abstract protected void onPulseCount(int pulsesCount);

}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ protected final void handle(DataMemoryMessage msg) {
*
* @param strokes The new stroke count.
*/
protected abstract void onStrokeCountUpdated(int strokes);
abstract protected void onStrokeCountUpdated(int strokes);

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ public final void handle(AbstractMessage msg) {
*
* @param strokeType The type of stroke (e.g. start or end), never null.
*/
abstract void onStroke(StrokeType strokeType);
abstract protected void onStroke(StrokeType strokeType);

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ protected final void handle(DataMemoryMessage msg) {
*
* @param tankVolume The volume of water in the tank (in liters).
*/
protected abstract void onTankVolumeUpdated(int tankVolume);
abstract protected void onTankVolumeUpdated(int tankVolume);

}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ public final void handle(DataMemoryMessage msg) {
*
* @param flags The flags of the workout mode, never null.
*/
protected abstract void onWorkoutModeUpdated(WorkoutFlags flags);
abstract protected void onWorkoutModeUpdated(WorkoutFlags flags);

}
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ protected final void handle(DataMemoryMessage msg) {
* @param intervalIndex The index of the workout interval.
* @param value The new value.
*/
protected abstract void onWorkoutIntervalUpdated(IntervalType intervalType, int intervalIndex, int value);
abstract protected void onWorkoutIntervalUpdated(IntervalType intervalType, int intervalIndex, int value);

}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private static MemoryLocation getMemoryLocation(ValueType valueType) {


@Override
void handle(DataMemoryMessage msg) {
protected void handle(DataMemoryMessage msg) {
int value = intFromHighAndLow(msg.getValue2(), msg.getValue1());

// If the received value is the same as before,
Expand All @@ -90,6 +90,6 @@ void handle(DataMemoryMessage msg) {
* @param valueType The value type, never null.
* @param value The new value.
*/
abstract void onTotalWorkoutValueUpdated(ValueType valueType, int value);
abstract protected void onTotalWorkoutValueUpdated(ValueType valueType, int value);

}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void handle_withOtherLocationMessage_doesntNotifiesInternalHandler() {
private AbstractMemorySubscription newAbstractMemorySubscription(Memory memory, MemoryLocation location) {
return new AbstractMemorySubscription(memory, location) {
@Override
void handle(DataMemoryMessage msg) {
protected void handle(DataMemoryMessage msg) {
internalSubscription.handle(msg);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public class TestDebugSubscription {
public void new_withNullMemory_throwsNPE() {
new DebugSubscription(null, CLOCK_DOWN_DEC) {
@Override
void handle(DataMemoryMessage msg) {}
protected void handle(DataMemoryMessage msg) {}
};
}

@Test(expected = NullPointerException.class)
public void new_withNullMemoryLocation_throwsNPE() {
new DebugSubscription(SINGLE_MEMORY, null) {
@Override
void handle(DataMemoryMessage msg) {}
protected void handle(DataMemoryMessage msg) {}
};
}

Expand All @@ -43,7 +43,7 @@ void handle(DataMemoryMessage msg) {}
public void poll_returnsMessageForConstructorValues() {
DebugSubscription subscription = new DebugSubscription(DOUBLE_MEMORY, M_S_LOW_AVERAGE) {
@Override
void handle(DataMemoryMessage msg) {}
protected void handle(DataMemoryMessage msg) {}
};

ReadMemoryMessage msg = (ReadMemoryMessage) subscription.poll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class TestIntensitySubscription {
public void new_withNull_throwsNPE() {
new IntensitySubscription(null) {
@Override
void onIntensityUpdated(IntensityType intensityType, int intensity) {}
protected void onIntensityUpdated(IntensityType intensityType, int intensity) {}
};
}

Expand Down Expand Up @@ -106,7 +106,7 @@ public void handle_withOtherMessage_doesntNotifyOnAverageStrokeTimeUpdate() {
private IntensitySubscription newIntensitySubscription(IntensityType type) {
return new IntensitySubscription(type) {
@Override
void onIntensityUpdated(IntensityType intensityType, int intensity) {
protected void onIntensityUpdated(IntensityType intensityType, int intensity) {
internalSubscription.onIntensityUpdated(intensityType, intensity);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class TestPulseCountSubscription {
public void setUp() {
subscription = new PulseCountSubscription() {
@Override
void onPulseCount(int pulsesCount) {
protected void onPulseCount(int pulsesCount) {
internalSubscription.onPulseCount(pulsesCount);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class TestStrokeSubscription {
public void setUp() {
subscription = new StrokeSubscription() {
@Override
void onStroke(StrokeType strokeType) {
protected void onStroke(StrokeType strokeType) {
internalSubscription.onStroke(strokeType);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void handle_for2DifferentMessages_notifiesTwice() {
private WorkoutTotalSubscription newWorkoutTotalSubscription(ValueType valueType) {
return new WorkoutTotalSubscription(valueType) {
@Override
void onTotalWorkoutValueUpdated(ValueType valueType, int value) {
protected void onTotalWorkoutValueUpdated(ValueType valueType, int value) {
internalSubscription.onTotalWorkoutValueUpdated(valueType, value);
}
};
Expand Down

0 comments on commit 5ead7b4

Please sign in to comment.