// Path: reactive-conversion-jackson/src/main/java/com/github/jloisel/reactive/conversion/jackson/JacksonDeserializer.java
// static final String END_OBJECT = "}";
// 
// Path: reactive-conversion-jackson/src/main/java/com/github/jloisel/reactive/conversion/jackson/JacksonDeserializer.java
// static final String START_OBJECT = "{\"entity\":";
// 
// Path: reactive-conversion-api/src/main/java/com/github/jloisel/reactive/conversion/api/Serializer.java
// public interface Serializer<T extends ReactiveEntity> extends
//  Func1<T, RawJsonDocument> {
// 
// }
// 
// Path: reactive-entity-api/src/main/java/com/github/jloisel/reactive/entity/api/ReactiveEntity.java
// public interface ReactiveEntity {
// 
//   /**
//    * @return id of the entity
//    */
//   String getId();
// }


import static com.github.jloisel.reactive.conversion.jackson.JacksonDeserializer.END_OBJECT;
import static com.github.jloisel.reactive.conversion.jackson.JacksonDeserializer.START_OBJECT;
import static lombok.AccessLevel.PACKAGE;
import static lombok.AccessLevel.PRIVATE;
import java.io.IOException;
import lombok.AllArgsConstructor;
import lombok.NonNull;
import lombok.experimental.FieldDefaults;
import com.couchbase.client.java.document.RawJsonDocument;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.github.jloisel.reactive.conversion.api.Serializer;
import com.github.jloisel.reactive.entity.api.ReactiveEntity;
package com.github.jloisel.reactive.conversion.jackson;





@AllArgsConstructor(access = PACKAGE)
@FieldDefaults(level = PRIVATE, makeFinal = true)
final class JacksonSerializer<T extends ReactiveEntity> implements Serializer<T> {
  @NonNull
  ObjectMapper mapper;
  @NonNull
  TypeReference<BeanWrapper<T>> reference;

  @Override
// Path: reactive-conversion-jackson/src/main/java/com/github/jloisel/reactive/conversion/jackson/JacksonDeserializer.java
// static final String END_OBJECT = "}";
// 
// Path: reactive-conversion-jackson/src/main/java/com/github/jloisel/reactive/conversion/jackson/JacksonDeserializer.java
// static final String START_OBJECT = "{\"entity\":";
// 
// Path: reactive-conversion-api/src/main/java/com/github/jloisel/reactive/conversion/api/Serializer.java
// public interface Serializer<T extends ReactiveEntity> extends
//  Func1<T, RawJsonDocument> {
// 
// }
// 
// Path: reactive-entity-api/src/main/java/com/github/jloisel/reactive/entity/api/ReactiveEntity.java
// public interface ReactiveEntity {
// 
//   /**
//    * @return id of the entity
//    */
//   String getId();
// }


// Path: reactive-conversion-jackson/src/main/java/com/github/jloisel/reactive/conversion/jackson/JacksonSerializer.java
import static com.github.jloisel.reactive.conversion.jackson.JacksonDeserializer.END_OBJECT;
import static com.github.jloisel.reactive.conversion.jackson.JacksonDeserializer.START_OBJECT;
import static lombok.AccessLevel.PACKAGE;
import static lombok.AccessLevel.PRIVATE;
import java.io.IOException;
import lombok.AllArgsConstructor;
import lombok.NonNull;
import lombok.experimental.FieldDefaults;
import com.couchbase.client.java.document.RawJsonDocument;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.github.jloisel.reactive.conversion.api.Serializer;
import com.github.jloisel.reactive.entity.api.ReactiveEntity;

package com.github.jloisel.reactive.conversion.jackson;





@AllArgsConstructor(access = PACKAGE)
@FieldDefaults(level = PRIVATE, makeFinal = true)
final class JacksonSerializer<T extends ReactiveEntity> implements Serializer<T> {
  @NonNull
  ObjectMapper mapper;
  @NonNull
  TypeReference<BeanWrapper<T>> reference;

  @Override
  public RawJsonDocument call(final T bean) {