io.quarkus.hal.HalLinkJacksonSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-hal Show documentation
Show all versions of quarkus-hal Show documentation
Hypertext Application Language (HAL) support
The newest version!
package io.quarkus.hal;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
public class HalLinkJacksonSerializer extends JsonSerializer {
@Override
public void serialize(HalLink value, JsonGenerator generator, SerializerProvider serializers) throws IOException {
generator.writeStartObject();
generator.writeObjectField("href", value.getHref());
if (value.getTitle() != null) {
generator.writeObjectField("title", value.getTitle());
}
if (value.getType() != null) {
generator.writeObjectField("type", value.getType());
}
generator.writeEndObject();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy