K
- The map key type.V
- The map value type.public final class MapObfuscator<K,V> extends Object
toString()
method is called.
The end result is similar to Obfuscator.obfuscateMap(Map)
, except this class gives a more fine-grained control over which values to
obfuscate and with which obfuscator.
Modifier and Type | Class and Description |
---|---|
static class |
MapObfuscator.Builder<K,V>
A builder for
MapObfuscators . |
static class |
MapObfuscator.StringKeyedBuilder<V>
A builder for
MapObfuscators that use String keys. |
Modifier and Type | Method and Description |
---|---|
static <K,V> MapObfuscator.Builder<K,V> |
builder()
Returns a builder that will create
MapObfuscators . |
boolean |
equals(Object o) |
int |
hashCode() |
Map<K,V> |
obfuscateMap(Map<K,V> map)
Obfuscates a map.
|
Map<K,V> |
obfuscateMap(Map<K,V> map,
Function<? super V,? extends CharSequence> valueRepresentation)
Obfuscates a map.
|
static <V> MapObfuscator.StringKeyedBuilder<V> |
stringKeyedBuilder()
Returns a builder that will create
MapObfuscators that support maps with String keys. |
String |
toString() |
public Map<K,V> obfuscateMap(Map<K,V> map)
string representation
will be used to obfuscate the value.
The result will be a map that will behave exactly the same as the given map, except it will obfuscate each value when its
toString()
method is called. This is different from Obfuscator.obfuscateObject(Object)
because it will not
obfuscate the map structure or the number of entries.
map
- The map to obfuscate.NullPointerException
- If the given map is null
.public Map<K,V> obfuscateMap(Map<K,V> map, Function<? super V,? extends CharSequence> valueRepresentation)
The result will be a map that will behave exactly the same as the given map, except it will obfuscate each value when its
toString()
method is called. This is different from Obfuscator.obfuscateObject(Object)
because it will not
obfuscate the map structure or the number of entries.
map
- The map to obfuscate.valueRepresentation
- The function to use to create the character representation for each value.NullPointerException
- If the given map or function is null
.public static <K,V> MapObfuscator.Builder<K,V> builder()
MapObfuscators
.K
- The map key type.V
- The map value type.MapObfuscators
.public static <V> MapObfuscator.StringKeyedBuilder<V> stringKeyedBuilder()
MapObfuscators
that support maps with String
keys.V
- The map value type.MapObfuscators
that support maps with String
keys.Copyright © 2020–2023. All rights reserved.