# Transformer

com.google.api.server.spi.config

## Interface Transformer\<TFrom,TTo\>

-

  Type Parameters:
  :   `TFrom` - The type being transformed
  :   `TTo` - The type being transformed to

  *** ** * ** ***

  <br />

  ```
  public interface Transformer<TFrom,TTo>
  ```
  An interface used to transform between a bean type and another type during JSON serialization.


  A serializer is constructed using one of the following constructor signatures (sorted by
  precedence):
  1. A constructor taking in a single `java.lang.reflect.Type`. This is the type being serialized.
  2. A constructor taking in a single `java.lang.Class`. This is the class being serialized.
  3. A no-arg constructor

  <br />

-
  -

    ### Method Summary

    | Modifier and Type | Method and Description |
    |---|---|
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Transformer.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Transformer.html#transformFrom-TTo-(https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Transformer.html in)` Converts an object from the destination type into the source type. |
    | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Transformer.html` | `https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Transformer.html#transformTo-TFrom-(https://docs.cloud.google.com/endpoints/docs/frameworks/java/javadoc/com/google/api/server/spi/config/Transformer.html in)` Converts the source object into the destination type. |
    [All Methods Instance Methods Abstract Methods]

-
  -

    ### Method Detail


    -

      #### transformTo

      ```
      TTo transformTo(TFrom in)
      ```
      Converts the source object into the destination type.


    -

      #### transformFrom

      ```
      TFrom transformFrom(TTo in)
      ```
      Converts an object from the destination type into the source type.