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

io.restassured.internal.path.json.mapping.JsonPathGsonObjectDeserializer Maven / Gradle / Ivy

The newest version!
package io.restassured.internal.path.json.mapping;

import io.restassured.common.mapper.ObjectDeserializationContext;
import io.restassured.internal.common.assertion.AssertParameter;
import io.restassured.path.json.mapper.factory.GsonObjectMapperFactory;
import io.restassured.path.json.mapping.JsonPathObjectDeserializer;

public class JsonPathGsonObjectDeserializer implements JsonPathObjectDeserializer {
    public JsonPathGsonObjectDeserializer(GsonObjectMapperFactory factory) {
        AssertParameter.notNull(factory, "GsonObjectMapperFactory");
        this.factory = factory;
    }

    @Override
    public  T deserialize(ObjectDeserializationContext ctx) {
        return factory.create(ctx.getType(), ctx.getCharset()).fromJson(ctx.getDataToDeserialize().asString(), ctx.getType());
    }

    private final GsonObjectMapperFactory factory;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy