Skip to content

Commit 6fad28b

Browse files
authored
Cleanup of Properties usage (#7)
1 parent 7b3d0a3 commit 6fad28b

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

metrics/src/main/java/io/scalecube/metrics/CountersRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public Context countersValuesBufferLength(int countersValuesBufferLength) {
202202

203203
public Context countersValuesBufferLength(String countersValuesBufferLength) {
204204
if (countersValuesBufferLength != null) {
205-
this.countersValuesBufferLength = Integer.parseInt(countersValuesBufferLength);
205+
return countersValuesBufferLength(Integer.parseInt(countersValuesBufferLength));
206206
}
207207
return this;
208208
}
@@ -236,7 +236,7 @@ public Context dirDeleteOnShutdown(boolean dirDeleteOnShutdown) {
236236

237237
public Context dirDeleteOnShutdown(String dirDeleteOnShutdown) {
238238
if (dirDeleteOnShutdown != null) {
239-
this.dirDeleteOnShutdown = Boolean.parseBoolean(dirDeleteOnShutdown);
239+
return dirDeleteOnShutdown(Boolean.parseBoolean(dirDeleteOnShutdown));
240240
}
241241
return this;
242242
}

metrics/src/main/java/io/scalecube/metrics/MetricsRecorder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public Context dirDeleteOnShutdown(boolean dirDeleteOnShutdown) {
362362

363363
public Context dirDeleteOnShutdown(String dirDeleteOnShutdown) {
364364
if (dirDeleteOnShutdown != null) {
365-
this.dirDeleteOnShutdown = Boolean.parseBoolean(dirDeleteOnShutdown);
365+
return dirDeleteOnShutdown(Boolean.parseBoolean(dirDeleteOnShutdown));
366366
}
367367
return this;
368368
}
@@ -396,7 +396,7 @@ public Context metricsBufferLength(int metricsBufferLength) {
396396

397397
public Context metricsBufferLength(String metricsBufferLength) {
398398
if (metricsBufferLength != null) {
399-
this.metricsBufferLength = Integer.parseInt(metricsBufferLength);
399+
return metricsBufferLength(Integer.parseInt(metricsBufferLength));
400400
}
401401
return this;
402402
}
@@ -427,8 +427,8 @@ public Context idleStrategy(IdleStrategy idleStrategy) {
427427
public Context idleStrategy(String idleStrategy) {
428428
if (idleStrategy != null) {
429429
try {
430-
this.idleStrategy =
431-
(IdleStrategy) Class.forName(idleStrategy).getConstructor().newInstance();
430+
return idleStrategy(
431+
(IdleStrategy) Class.forName(idleStrategy).getConstructor().newInstance());
432432
} catch (Exception ex) {
433433
LangUtil.rethrowUnchecked(ex);
434434
}

metrics/src/main/java/io/scalecube/metrics/MetricsTransmitter.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public Context warnIfMetricsNotExists(boolean warnIfMetricsNotExists) {
255255

256256
public Context warnIfMetricsNotExists(String warnIfMetricsNotExists) {
257257
if (warnIfMetricsNotExists != null) {
258-
this.warnIfMetricsNotExists = Boolean.parseBoolean(warnIfMetricsNotExists);
258+
return warnIfMetricsNotExists(Boolean.parseBoolean(warnIfMetricsNotExists));
259259
}
260260
return this;
261261
}
@@ -280,8 +280,8 @@ public Context retryInterval(Duration retryInterval) {
280280

281281
public Context retryInterval(String retryInterval) {
282282
if (retryInterval != null) {
283-
this.retryInterval =
284-
Duration.ofNanos(SystemUtil.parseDuration("retryInterval", retryInterval));
283+
return retryInterval(
284+
Duration.ofNanos(SystemUtil.parseDuration("retryInterval", retryInterval)));
285285
}
286286
return this;
287287
}
@@ -297,8 +297,8 @@ public Context heartbeatTimeout(Duration heartbeatTimeout) {
297297

298298
public Context heartbeatTimeout(String heartbeatTimeout) {
299299
if (heartbeatTimeout != null) {
300-
this.heartbeatTimeout =
301-
Duration.ofNanos(SystemUtil.parseDuration("heartbeatTimeout", heartbeatTimeout));
300+
return heartbeatTimeout(
301+
Duration.ofNanos(SystemUtil.parseDuration("heartbeatTimeout", heartbeatTimeout)));
302302
}
303303
return this;
304304
}
@@ -329,8 +329,8 @@ public Context idleStrategy(IdleStrategy idleStrategy) {
329329
public Context idleStrategy(String idleStrategy) {
330330
if (idleStrategy != null) {
331331
try {
332-
this.idleStrategy =
333-
(IdleStrategy) Class.forName(idleStrategy).getConstructor().newInstance();
332+
return idleStrategy(
333+
(IdleStrategy) Class.forName(idleStrategy).getConstructor().newInstance());
334334
} catch (Exception ex) {
335335
LangUtil.rethrowUnchecked(ex);
336336
}
@@ -353,7 +353,7 @@ public Context broadcastBufferLength(int broadcastBufferLength) {
353353

354354
public Context broadcastBufferLength(String broadcastBufferLength) {
355355
if (broadcastBufferLength != null) {
356-
this.broadcastBufferLength = Integer.parseInt(broadcastBufferLength);
356+
return broadcastBufferLength(Integer.parseInt(broadcastBufferLength));
357357
}
358358
return this;
359359
}

0 commit comments

Comments
 (0)