diff --git a/metrics/src/main/java/io/scalecube/metrics/CountersRegistry.java b/metrics/src/main/java/io/scalecube/metrics/CountersRegistry.java index 10a30c6..8795e02 100644 --- a/metrics/src/main/java/io/scalecube/metrics/CountersRegistry.java +++ b/metrics/src/main/java/io/scalecube/metrics/CountersRegistry.java @@ -202,7 +202,7 @@ public Context countersValuesBufferLength(int countersValuesBufferLength) { public Context countersValuesBufferLength(String countersValuesBufferLength) { if (countersValuesBufferLength != null) { - this.countersValuesBufferLength = Integer.parseInt(countersValuesBufferLength); + return countersValuesBufferLength(Integer.parseInt(countersValuesBufferLength)); } return this; } @@ -236,7 +236,7 @@ public Context dirDeleteOnShutdown(boolean dirDeleteOnShutdown) { public Context dirDeleteOnShutdown(String dirDeleteOnShutdown) { if (dirDeleteOnShutdown != null) { - this.dirDeleteOnShutdown = Boolean.parseBoolean(dirDeleteOnShutdown); + return dirDeleteOnShutdown(Boolean.parseBoolean(dirDeleteOnShutdown)); } return this; } diff --git a/metrics/src/main/java/io/scalecube/metrics/MetricsRecorder.java b/metrics/src/main/java/io/scalecube/metrics/MetricsRecorder.java index cea6f66..5384623 100644 --- a/metrics/src/main/java/io/scalecube/metrics/MetricsRecorder.java +++ b/metrics/src/main/java/io/scalecube/metrics/MetricsRecorder.java @@ -362,7 +362,7 @@ public Context dirDeleteOnShutdown(boolean dirDeleteOnShutdown) { public Context dirDeleteOnShutdown(String dirDeleteOnShutdown) { if (dirDeleteOnShutdown != null) { - this.dirDeleteOnShutdown = Boolean.parseBoolean(dirDeleteOnShutdown); + return dirDeleteOnShutdown(Boolean.parseBoolean(dirDeleteOnShutdown)); } return this; } @@ -396,7 +396,7 @@ public Context metricsBufferLength(int metricsBufferLength) { public Context metricsBufferLength(String metricsBufferLength) { if (metricsBufferLength != null) { - this.metricsBufferLength = Integer.parseInt(metricsBufferLength); + return metricsBufferLength(Integer.parseInt(metricsBufferLength)); } return this; } @@ -427,8 +427,8 @@ public Context idleStrategy(IdleStrategy idleStrategy) { public Context idleStrategy(String idleStrategy) { if (idleStrategy != null) { try { - this.idleStrategy = - (IdleStrategy) Class.forName(idleStrategy).getConstructor().newInstance(); + return idleStrategy( + (IdleStrategy) Class.forName(idleStrategy).getConstructor().newInstance()); } catch (Exception ex) { LangUtil.rethrowUnchecked(ex); } diff --git a/metrics/src/main/java/io/scalecube/metrics/MetricsTransmitter.java b/metrics/src/main/java/io/scalecube/metrics/MetricsTransmitter.java index a75665c..657b7cf 100644 --- a/metrics/src/main/java/io/scalecube/metrics/MetricsTransmitter.java +++ b/metrics/src/main/java/io/scalecube/metrics/MetricsTransmitter.java @@ -255,7 +255,7 @@ public Context warnIfMetricsNotExists(boolean warnIfMetricsNotExists) { public Context warnIfMetricsNotExists(String warnIfMetricsNotExists) { if (warnIfMetricsNotExists != null) { - this.warnIfMetricsNotExists = Boolean.parseBoolean(warnIfMetricsNotExists); + return warnIfMetricsNotExists(Boolean.parseBoolean(warnIfMetricsNotExists)); } return this; } @@ -280,8 +280,8 @@ public Context retryInterval(Duration retryInterval) { public Context retryInterval(String retryInterval) { if (retryInterval != null) { - this.retryInterval = - Duration.ofNanos(SystemUtil.parseDuration("retryInterval", retryInterval)); + return retryInterval( + Duration.ofNanos(SystemUtil.parseDuration("retryInterval", retryInterval))); } return this; } @@ -297,8 +297,8 @@ public Context heartbeatTimeout(Duration heartbeatTimeout) { public Context heartbeatTimeout(String heartbeatTimeout) { if (heartbeatTimeout != null) { - this.heartbeatTimeout = - Duration.ofNanos(SystemUtil.parseDuration("heartbeatTimeout", heartbeatTimeout)); + return heartbeatTimeout( + Duration.ofNanos(SystemUtil.parseDuration("heartbeatTimeout", heartbeatTimeout))); } return this; } @@ -329,8 +329,8 @@ public Context idleStrategy(IdleStrategy idleStrategy) { public Context idleStrategy(String idleStrategy) { if (idleStrategy != null) { try { - this.idleStrategy = - (IdleStrategy) Class.forName(idleStrategy).getConstructor().newInstance(); + return idleStrategy( + (IdleStrategy) Class.forName(idleStrategy).getConstructor().newInstance()); } catch (Exception ex) { LangUtil.rethrowUnchecked(ex); } @@ -353,7 +353,7 @@ public Context broadcastBufferLength(int broadcastBufferLength) { public Context broadcastBufferLength(String broadcastBufferLength) { if (broadcastBufferLength != null) { - this.broadcastBufferLength = Integer.parseInt(broadcastBufferLength); + return broadcastBufferLength(Integer.parseInt(broadcastBufferLength)); } return this; }