pl.szczepanik.silencio.converters.NumberSequenceConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of silencio Show documentation
Show all versions of silencio Show documentation
Silencio is a Java library for transforming and converting XML, JSON, Properties, YAML and other formats. It
is applicable for most operations such as obfuscation, encryption, minimisation (minifying), anonymous. Library
is fully customizable and extensible.
The newest version!
package pl.szczepanik.silencio.converters;
import java.util.HashMap;
import java.util.Map;
import pl.szczepanik.silencio.api.Converter;
import pl.szczepanik.silencio.core.Key;
import pl.szczepanik.silencio.core.Value;
/**
* Converter that changes each passed value into number in way that the same passed value has the same number.
*
* @author Damian Szczepanik (damianszczepanik@github)
*/
public class NumberSequenceConverter implements Converter {
// Reserved for null value
private static final int NULL_INDEX = 0;
/**
* Keeps passed values and corresponding numbers;
*/
private final Map