JsonGenerator.Converter (Groovy 5.0.6)
Description: declaration: package: groovy.json, interface: JsonGenerator, interface: Converter

Package groovy.json

# Interface JsonGenerator.Converter

All Known Implementing Classes:
  `DefaultJsonGenerator.ClosureConverter`

Enclosing interface:
  JsonGenerator

public static interface JsonGenerator.Converter
Handles converting a given type.

Since:
  2.5.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `convert(Object value, String key)`
  Converts a given object.
  `boolean`
  `handles(Class<?> type)`
  Returns `true` if this converter can handle conversions of the given type.

- ## Method Details

  - ### handles

    boolean handles(Class<?> type)
    Returns `true` if this converter can handle conversions of the given type.
    Parameters:
      `type` - the type of the object to convert
    Returns:
      `true` if this converter can successfully convert values of the given type, else `false`

  - ### convert

    Object convert(Object value, String key)
    Converts a given object.
    Parameters:
      `value` - the object to convert
      `key` - the key name for the value, may be `null`
    Returns:
      the converted object