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

com.aliyun.datahub.client.impl.serializer.UpdateSubscriptionRequestSerializer Maven / Gradle / Ivy

There is a newer version: 2.25.6
Show newest version
package com.aliyun.datahub.client.impl.serializer;

import com.aliyun.datahub.client.impl.request.UpdateSubscriptionRequest;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

public class UpdateSubscriptionRequestSerializer extends JsonSerializer {
    @Override
    public void serialize(UpdateSubscriptionRequest updateSubscriptionRequest, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
        jsonGenerator.writeStartObject();

        if (updateSubscriptionRequest.getComment() != null) {
            jsonGenerator.writeStringField("Comment", updateSubscriptionRequest.getComment());
        }

        if (updateSubscriptionRequest.getState() != null) {
            jsonGenerator.writeNumberField("State", updateSubscriptionRequest.getState().getValue());
        }

        jsonGenerator.writeEndObject();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy