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

io.quarkus.hal.HalLinkJsonbSerializer Maven / Gradle / Ivy

package io.quarkus.hal;

import jakarta.json.bind.serializer.JsonbSerializer;
import jakarta.json.bind.serializer.SerializationContext;
import jakarta.json.stream.JsonGenerator;

public class HalLinkJsonbSerializer implements JsonbSerializer {

    @Override
    public void serialize(HalLink value, JsonGenerator generator, SerializationContext context) {
        generator.writeStartObject();
        generator.write("href", value.getHref());
        if (value.getTitle() != null) {
            generator.write("title", value.getTitle());
        }

        if (value.getType() != null) {
            generator.write("type", value.getType());
        }

        generator.writeEnd();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy