Converted EntryBase to a generic abstract class
This commit is contained in:
parent
dacacbab56
commit
23540cbc8e
7 changed files with 200 additions and 284 deletions
|
@ -16,17 +16,15 @@
|
|||
|
||||
package rife.bld.extension.propertyfile;
|
||||
|
||||
import java.util.function.IntFunction;
|
||||
|
||||
/**
|
||||
* Declares the modifications to be made to an {@link java.util.Properties Integer-based property}.
|
||||
*
|
||||
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
||||
* @since 1.0
|
||||
*/
|
||||
public class EntryInt extends EntryBase {
|
||||
public class EntryInt extends EntryBase<EntryInt> {
|
||||
/**
|
||||
* Creates a new date {@link Entry entry}.
|
||||
* Creates a new {@link EntryInt entry}.
|
||||
*
|
||||
* @param key the required property key
|
||||
*/
|
||||
|
@ -34,39 +32,6 @@ public class EntryInt extends EntryBase {
|
|||
super(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@link EntryInt entry}.
|
||||
*
|
||||
* @param calc the calculation function.
|
||||
* @return this instance
|
||||
*/
|
||||
public EntryInt calc(IntFunction<Integer> calc) {
|
||||
setCalc(calc);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the initial value to set the {@link java.util.Properties property} to, if not already defined.
|
||||
*
|
||||
* @param defaultValue the default value
|
||||
* @return this instance
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public EntryInt defaultValue(Object defaultValue) {
|
||||
setDefaultValue(defaultValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link EntryInt entry} up for deletion.
|
||||
*
|
||||
* @return this instance
|
||||
*/
|
||||
public EntryInt delete() {
|
||||
setDelete();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the new {@link java.util.Properties property} value to an integer.
|
||||
*
|
||||
|
@ -74,7 +39,17 @@ public class EntryInt extends EntryBase {
|
|||
* @return this instance
|
||||
*/
|
||||
public EntryInt set(int i) {
|
||||
setNewValue(i);
|
||||
newValue(i);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the {@link java.text.DecimalFormat DecimalFormat} pattern.
|
||||
*
|
||||
* @param pattern the pattern
|
||||
*/
|
||||
public EntryInt pattern(String pattern) {
|
||||
super.pattern(pattern);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue