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

io.smallrye.reactive.messaging.json.jsonb.JsonBMapping Maven / Gradle / Ivy

package io.smallrye.reactive.messaging.json.jsonb;

import jakarta.annotation.Priority;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.json.bind.Jsonb;

import io.smallrye.reactive.messaging.json.JsonMapping;

@ApplicationScoped
@Priority(value = JsonMapping.DEFAULT_PRIORITY + 1)
public class JsonBMapping implements JsonMapping {
    @Inject
    Jsonb jsonb;

    @Override
    public String toJson(Object object) {
        return jsonb.toJson(object);
    }

    @Override
    public  T fromJson(String str, Class type) {
        return jsonb.fromJson(str, type);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy