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

ru.cwcode.tkach.config.jackson.module.MessageArrSerializer Maven / Gradle / Ivy

The newest version!
package ru.cwcode.tkach.config.jackson.module;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import ru.cwcode.tkach.locale.MessageArr;

import java.io.IOException;
import java.util.List;

public class MessageArrSerializer extends JsonSerializer {
  @Override
  public void serialize(MessageArr value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
    List list = value.toList();
    gen.writeArray(list.toArray(new String[0]), 0, list.size());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy