@@ -0,0 +1,1719 @@
+// Copyright (C) 2016 The Android Open Source Project%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A// http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0Apackage com.google.gerrit.server.events;%0A%0Aimport static com.google.common.base.Preconditions.checkArgument;%0A%0Aimport com.google.common.base.Supplier;%0Aimport com.google.common.base.Suppliers;%0Aimport com.google.gson.JsonDeserializationContext;%0Aimport com.google.gson.JsonDeserializer;%0Aimport com.google.gson.JsonElement;%0Aimport com.google.gson.JsonParseException;%0A%0Aimport java.lang.reflect.ParameterizedType;%0Aimport java.lang.reflect.Type;%0A%0Apublic class SupplierDeserializer implements JsonDeserializer%3CSupplier%3C?%3E%3E %7B%0A%0A  @Override%0A  public Supplier%3C?%3E deserialize(JsonElement json, Type typeOfT,%0A      JsonDeserializationContext context) throws JsonParseException %7B%0A    checkArgument(typeOfT instanceof ParameterizedType);%0A    ParameterizedType parameterizedType = (ParameterizedType) typeOfT;%0A    if (parameterizedType.getActualTypeArguments().length != 1) %7B%0A      throw new JsonParseException(%0A          %22Expected one parameter type in Supplier interface.%22);%0A    %7D%0A    Type supplierOf = parameterizedType.getActualTypeArguments()%5B0%5D;%0A    return Suppliers.ofInstance(context.deserialize(json, supplierOf));%0A  %7D%0A%7D%0A

Add custom JSON deserializer for Supplier