From 3db6ca026d8131b22233dc10b49ba23285c5d275 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 23 Jun 2024 10:46:17 -0700 Subject: [PATCH] Removed argument from safeDelete() --- .../bld/extension/propertyfile/Entry.java | 2 +- .../bld/extension/propertyfile/EntryBase.java | 70 +++++++++---------- .../bld/extension/propertyfile/EntryDate.java | 2 +- .../bld/extension/propertyfile/EntryInt.java | 2 +- 4 files changed, 37 insertions(+), 39 deletions(-) diff --git a/src/main/java/rife/bld/extension/propertyfile/Entry.java b/src/main/java/rife/bld/extension/propertyfile/Entry.java index 816ce21..379255c 100644 --- a/src/main/java/rife/bld/extension/propertyfile/Entry.java +++ b/src/main/java/rife/bld/extension/propertyfile/Entry.java @@ -53,7 +53,7 @@ public class Entry extends EntryBase { * @return the entry */ public Entry delete() { - setDelete(true); + setDelete(); return this; } diff --git a/src/main/java/rife/bld/extension/propertyfile/EntryBase.java b/src/main/java/rife/bld/extension/propertyfile/EntryBase.java index b381b0f..b724ed3 100644 --- a/src/main/java/rife/bld/extension/propertyfile/EntryBase.java +++ b/src/main/java/rife/bld/extension/propertyfile/EntryBase.java @@ -28,15 +28,15 @@ import java.util.function.IntFunction; */ @SuppressWarnings("PMD.DataClass") public class EntryBase { - private IntFunction calc; - private Object defaultValue; - private boolean isDelete; - private String key; - private BiFunction modify; - private String modifyValue = ""; - private Object newValue; - private String pattern = ""; - private EntryDate.Units unit = EntryDate.Units.DAY; + private IntFunction calc_; + private Object defaultValue_; + private boolean isDelete_; + private String key_; + private String modifyValue_ = ""; + private BiFunction modify_; + private Object newValue_; + private String pattern_ = ""; + private EntryDate.Units unit_ = EntryDate.Units.DAY; /** * Creates a new {@link EntryBase entry}. @@ -44,7 +44,7 @@ public class EntryBase { * @param key the required property key */ public EntryBase(String key) { - this.key = key; + key_ = key; } /** @@ -53,7 +53,7 @@ public class EntryBase { * @return the calc function */ protected IntFunction getCalc() { - return calc; + return calc_; } /** @@ -62,7 +62,7 @@ public class EntryBase { * @return the default value */ protected Object getDefaultValue() { - return defaultValue; + return defaultValue_; } /** @@ -71,7 +71,7 @@ public class EntryBase { * @return the key */ protected String getKey() { - return key; + return key_; } /** @@ -80,16 +80,16 @@ public class EntryBase { * @return the modify function */ protected BiFunction getModify() { - return modify; + return modify_; } /** - * Returns the value to be used in the {@link #modify} function. + * Returns the value to be used in the {@link #modify_} function. * * @return the modify value */ protected String getModifyValue() { - return modifyValue; + return modifyValue_; } /** @@ -98,7 +98,7 @@ public class EntryBase { * @return the new value */ public Object getNewValue() { - return newValue; + return newValue_; } /** @@ -107,7 +107,7 @@ public class EntryBase { * @return the pattern */ protected String getPattern() { - return pattern; + return pattern_; } /** @@ -116,7 +116,7 @@ public class EntryBase { * @return the unit */ protected EntryDate.Units getUnit() { - return unit; + return unit_; } /** @@ -125,7 +125,7 @@ public class EntryBase { * @return {@code true} or {@code false} */ protected boolean isDelete() { - return isDelete; + return isDelete_; } /** @@ -136,7 +136,7 @@ public class EntryBase { */ @SuppressWarnings("unused") public EntryBase key(String key) { - setKey(key); + key_ = key; return this; } @@ -146,7 +146,7 @@ public class EntryBase { * @param calc the calc function */ protected void setCalc(IntFunction calc) { - this.calc = calc; + calc_ = calc; } /** @@ -155,16 +155,14 @@ public class EntryBase { * @param defaultValue the default value */ protected void setDefaultValue(Object defaultValue) { - this.defaultValue = defaultValue; + defaultValue_ = defaultValue; } /** - * Sets whether the {@link java.util.Properties property} should be deleted. - * - * @param delete {@code true} or {@code false} + * Sets the {@link java.util.Properties property} to be deleted. */ - protected void setDelete(boolean delete) { - isDelete = delete; + protected void setDelete() { + isDelete_ = true; } /** @@ -173,7 +171,7 @@ public class EntryBase { * @param key the {@link java.util.Properties property} key */ protected void setKey(String key) { - this.key = key; + key_ = key; } /** @@ -182,7 +180,7 @@ public class EntryBase { * @param modify the modify function */ protected void setModify(BiFunction modify) { - this.modify = modify; + modify_ = modify; } /** @@ -192,8 +190,8 @@ public class EntryBase { * @param modify the modify function */ protected void setModify(String value, BiFunction modify) { - this.modifyValue = value; - this.modify = modify; + modifyValue_ = value; + modify_ = modify; } /** @@ -202,7 +200,7 @@ public class EntryBase { * @param value the modify value. */ protected void setModifyValue(String value) { - this.modifyValue = value; + modifyValue_ = value; } /** @@ -211,7 +209,7 @@ public class EntryBase { * @param newValue the new value */ public void setNewValue(Object newValue) { - this.newValue = newValue; + newValue_ = newValue; } /** @@ -221,7 +219,7 @@ public class EntryBase { * @param pattern the pattern */ protected void setPattern(String pattern) { - this.pattern = pattern; + pattern_ = pattern; } /** @@ -230,6 +228,6 @@ public class EntryBase { * @param unit the {@link EntryDate.Units unit} */ protected void setUnit(EntryDate.Units unit) { - this.unit = unit; + unit_ = unit; } } diff --git a/src/main/java/rife/bld/extension/propertyfile/EntryDate.java b/src/main/java/rife/bld/extension/propertyfile/EntryDate.java index 4d7fba3..a25b0e1 100644 --- a/src/main/java/rife/bld/extension/propertyfile/EntryDate.java +++ b/src/main/java/rife/bld/extension/propertyfile/EntryDate.java @@ -54,7 +54,7 @@ public class EntryDate extends EntryBase { * @return this instance */ public EntryDate delete() { - setDelete(true); + setDelete(); return this; } diff --git a/src/main/java/rife/bld/extension/propertyfile/EntryInt.java b/src/main/java/rife/bld/extension/propertyfile/EntryInt.java index 753d3e7..54226f4 100644 --- a/src/main/java/rife/bld/extension/propertyfile/EntryInt.java +++ b/src/main/java/rife/bld/extension/propertyfile/EntryInt.java @@ -63,7 +63,7 @@ public class EntryInt extends EntryBase { * @return this instance */ public EntryInt delete() { - setDelete(true); + setDelete(); return this; }