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

com.sinch.sdk.domains.conversation.templates.models.v2.ChannelTemplateOverrideMapper Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.sinch.sdk.domains.conversation.templates.models.v2;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sinch.sdk.core.models.OptionalValue;
import com.sinch.sdk.core.utils.databind.Mapper;
import com.sinch.sdk.domains.conversation.models.v1.TemplateReference;
import com.sinch.sdk.domains.conversation.models.v1.TemplateReferenceImpl;

public class ChannelTemplateOverrideMapper {

  public static void initMapper() {

    Mapper.getInstance()
        .addMixIn(ChannelTemplateOverride.class, ChannelTemplateOverrideMapperMixinSerializer.class)
        .addMixIn(
            ChannelTemplateOverride.Builder.class, ChannelTemplateOverrideBuilderMapperMixin.class);
  }

  static class ChannelTemplateOverrideMapperMixinSerializer extends ChannelTemplateOverrideImpl {

    @Override
    @JsonSerialize(using = TemplateReferenceImpl.DelegatedSerializer.class)
    public OptionalValue templateReference() {
      return super.templateReference();
    }
  }

  static class ChannelTemplateOverrideBuilderMapperMixin
      extends ChannelTemplateOverrideImpl.Builder {

    @Override
    @JsonDeserialize(using = TemplateReferenceImpl.DelegatedDeSerializer.class)
    public ChannelTemplateOverrideImpl.Builder setTemplateReference(
        TemplateReference templateReference) {
      return super.setTemplateReference(templateReference);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy