package com.datadog.iast.model.json;

import com.datadog.iast.model.VulnerabilityType;
import com.squareup.moshi.JsonWriter;
import java.io.IOException;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class VulnerabilityTypeAdapter extends FormattingAdapter<VulnerabilityType> {

  @Override
  public void toJson(@Nonnull final JsonWriter writer, @Nullable final VulnerabilityType value)
      throws IOException {
    if (value == null) {
      writer.nullValue();
      return;
    }
    writer.value(value.name());
  }
}
