All Downloads are FREE. Search and download functionalities are using the official Maven repository.

storm.parser.converter.serializer.BooleanStringSerializer Maven / Gradle / Ivy

package storm.parser.converter.serializer;

import java.lang.reflect.Type;

/**
 * Created by Dimitry Ivanov on 12.12.2015.
 */
public class BooleanStringSerializer implements StormSerializer {
    @Override
    public String serialize(Boolean aBoolean) {
        return aBoolean != null && aBoolean ? "true" : "false";
    }

    @Override
    public Boolean deserialize(Type type, String s) {
        return s != null && s.equalsIgnoreCase("true") ? Boolean.TRUE : Boolean.FALSE;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy