Skip to content

Commit a25fd9a

Browse files
committed
Refactor ITPSRetriever and ServerPulseAPI to remove default method implementations for TPS retrieval
1 parent ae73261 commit a25fd9a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

api/src/main/java/it/renvins/serverpulse/api/ServerPulseAPI.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ public interface ServerPulseAPI {
2626
* Retrieves the instance of ITPSRetriever.
2727
*
2828
* @return The ITPSRetriever instance.
29+
* @throws UnsupportedOperationException if the API implementation does not support TPS retrieval.
2930
*/
30-
ITPSRetriever getTPSRetriever();
31+
default ITPSRetriever getTPSRetriever() {
32+
throw new UnsupportedOperationException("TPSRetriever is not supported in this API implementation.");
33+
}
3134

3235
/**
3336
* Retrieves the instance of IDiskRetriever.

api/src/main/java/it/renvins/serverpulse/api/metrics/ITPSRetriever.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ public interface ITPSRetriever {
99
* The first value is the average TPS over the last minute,
1010
* the second value is the average TPS over the last 5 minutes,
1111
* and the third value is the average TPS over the last 15 minutes.
12-
* @throws UnsupportedOperationException if the platform does not support this operation.
1312
*/
14-
default double[] getTPS() {
15-
throw new UnsupportedOperationException("This method is not supported on this platform.");
16-
}
13+
double[] getTPS();
1714
}

0 commit comments

Comments
 (0)