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

com.arangodb.vst.VstSerializers Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
package com.arangodb.vst;

import com.arangodb.vst.internal.AuthenticationRequest;
import com.arangodb.vst.internal.JwtAuthenticationRequest;
import com.arangodb.shaded.fasterxml.jackson.core.JsonGenerator;
import com.arangodb.shaded.fasterxml.jackson.databind.JsonSerializer;
import com.arangodb.shaded.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

public final class VstSerializers {

    static final JsonSerializer AUTHENTICATION_REQUEST =
            new JsonSerializer() {
                @Override
                public void serialize(AuthenticationRequest value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
                    gen.writeStartArray();
                    gen.writeNumber(value.getVersion());
                    gen.writeNumber(value.getType());
                    gen.writeString(value.getEncryption());
                    gen.writeString(value.getUser());
                    gen.writeString(value.getPassword());
                    gen.writeEndArray();
                }
            };
    static final JsonSerializer JWT_AUTHENTICATION_REQUEST =
            new JsonSerializer() {
                @Override
                public void serialize(JwtAuthenticationRequest value, JsonGenerator gen,
                                      SerializerProvider serializers) throws IOException {
                    gen.writeStartArray();
                    gen.writeNumber(value.getVersion());
                    gen.writeNumber(value.getType());
                    gen.writeString(value.getEncryption());
                    gen.writeString(value.getToken());
                    gen.writeEndArray();
                }
            };

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy