Package org.apache.juneau.config.mod
Class Mod
java.lang.Object
org.apache.juneau.config.mod.Mod
- Direct Known Subclasses:
- XorEncodeMod
Specifies an entry modifier that is used to encode during write and decode during read of config entries.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionApplies this modification to the specified entry value.final StringApplies this modification to the specified entry value if it isn't already applied.final StringRemoves this modification from the specified entry value if it is applied.chargetId()Returns the modifier identifier character.booleanDetects whether this modification has been applied.Removes this modification to the specified entry value.
- 
Field Details- 
NO_OPA no-op modifier.
 
- 
- 
Constructor Details- 
Modpublic Mod(char id, Function<String, String> applyFunction, Function<String, String> removeFunction, Function<String, Boolean> detectFunction) Constructor.- Parameters:
- id- The character identifier.
- applyFunction- The function to apply when writing an entry. Can be- null if you override the- apply(String)method.
- removeFunction- The function to apply when reading an entry. Can be- null if you override the- remove(String)method.
- detectFunction- The function to apply to detect whether the modification has been made. Can be- null if you override the- isApplied(String)method.
 
 
- 
- 
Method Details- 
getIdReturns the modifier identifier character.- Returns:
- The modifier identifier character.
 
- 
isAppliedDetects whether this modification has been applied.- Parameters:
- value- The entry value being tested. Will never be- null .
- Returns:
- true if the modification has been made to the entry.
 
- 
applyApplies this modification to the specified entry value.Will only be called if isApplied(String)returnsfalse .- Parameters:
- value- The entry value being written. Will never be- null .
- Returns:
- The modified value.
 
- 
removeRemoves this modification to the specified entry value.Will only be called if isApplied(String)returnstrue .- Parameters:
- value- The entry value being read. Will never be- null .
- Returns:
- The unmodified value.
 
- 
doApplyApplies this modification to the specified entry value if it isn't already applied.- Parameters:
- value- The entry value being written. Will never be- null .
- Returns:
- The modified value.
 
- 
doRemoveRemoves this modification from the specified entry value if it is applied.- Parameters:
- value- The entry value being written. Will never be- null .
- Returns:
- The modified value.
 
 
-