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

org.onetwo.common.jackson.serializer.ToBooleanDeserializer Maven / Gradle / Ivy

package org.onetwo.common.jackson.serializer;

import java.io.IOException;

import org.onetwo.common.convert.Types;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;

public class ToBooleanDeserializer extends JsonDeserializer {

	@Override
	public Boolean deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
		boolean res = Types.asBoolean(p.getText());
		return res;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy