public static final class PropertiesObfuscator.Builder extends Object
PropertiesObfuscators
.Modifier and Type | Method and Description |
---|---|
PropertiesObfuscator |
build()
Creates a new
Properties obfuscator with the current settings of this builder. |
PropertiesObfuscator.Builder |
caseInsensitiveByDefault()
Sets the default case sensitivity for new properties to
CaseSensitivity.CASE_INSENSITIVE . |
PropertiesObfuscator.Builder |
caseSensitiveByDefault()
Sets the default case sensitivity for new properties to
CaseSensitivity.CASE_SENSITIVE . |
<R> R |
transform(Function<? super PropertiesObfuscator.Builder,? extends R> f)
This method allows the application of a function to this builder.
|
PropertiesObfuscator.Builder |
withDefaultObfuscator(Obfuscator obfuscator)
Sets the default obfuscator to use, for properties that have no specific obfuscator defined.
|
PropertiesObfuscator.Builder |
withProperty(String property,
Obfuscator obfuscator)
Adds a property to obfuscate.
|
PropertiesObfuscator.Builder |
withProperty(String property,
Obfuscator obfuscator,
CaseSensitivity caseSensitivity)
Adds a property to obfuscate.
|
public PropertiesObfuscator.Builder withProperty(String property, Obfuscator obfuscator)
withProperty(String, Obfuscator, CaseSensitivity)
with the last specified default case sensitivity
using caseSensitiveByDefault()
or caseInsensitiveByDefault()
. The default is CaseSensitivity.CASE_SENSITIVE
.property
- The name of the property.obfuscator
- The obfuscator to use for obfuscating the property.NullPointerException
- If the given property name or obfuscator is null
.IllegalArgumentException
- If a property with the same name and the same case sensitivity was already added.public PropertiesObfuscator.Builder withProperty(String property, Obfuscator obfuscator, CaseSensitivity caseSensitivity)
property
- The name of the property.obfuscator
- The obfuscator to use for obfuscating the property.caseSensitivity
- The case sensitivity for the property.NullPointerException
- If the given property name, obfuscator or case sensitivity is null
.IllegalArgumentException
- If a property with the same name and the same case sensitivity was already added.public PropertiesObfuscator.Builder caseSensitiveByDefault()
CaseSensitivity.CASE_SENSITIVE
. This is the default setting.
Note that this will not change the case sensitivity of any property that was already added.
public PropertiesObfuscator.Builder caseInsensitiveByDefault()
CaseSensitivity.CASE_INSENSITIVE
.
Note that this will not change the case sensitivity of any property that was already added.
public PropertiesObfuscator.Builder withDefaultObfuscator(Obfuscator obfuscator)
null
.obfuscator
- The default obfuscator to use. Use null
to only obfuscate specific properties.public <R> R transform(Function<? super PropertiesObfuscator.Builder,? extends R> f)
Any exception thrown by the function will be propagated to the caller.
R
- The type of the result of the function.f
- The function to apply.public PropertiesObfuscator build()
Properties
obfuscator with the current settings of this builder.Properties
obfuscator with the current settings of this builder.Copyright © 2020–2023. All rights reserved.