@Override
  public PriceLevel read(JsonReader reader) throws IOException {
    if (reader.peek() == JsonToken.NULL) {
      reader.nextNull();
      return null;
    }

    if (reader.peek() == JsonToken.NUMBER) {
      int priceLevel = reader.nextInt();

      switch (priceLevel) {
        case 0:
          return PriceLevel.FREE;
        case 1:
          return PriceLevel.INEXPENSIVE;
        case 2:
          return PriceLevel.MODERATE;
        case 3:
          return PriceLevel.EXPENSIVE;
        case 4:
          return PriceLevel.VERY_EXPENSIVE;
      }
    }

    return PriceLevel.UNKNOWN;
  }
This class handles conversion from JSON to {@link PriceLevel}.

<p>Please see <a
href="https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/TypeAdapter.html">GSON
Type Adapter</a> for more detail.
src/main/java/com/google/maps/internal/PriceLevelAdapter.java