I have a class Bucket which is passed as a generic type in the Comparator interface. I am working with GSON to register a type adapter for this type.
The typeadapter function has the signature
public GsonBuilder registerTypeAdapter(Type type, Object typeAdapter)
I want to pass the first argument as the type object
java.util.Comparator<org.elasticsearch.search.aggregations.bucket.terms.Terms$Bucket>
I tried Comparator<Terms.Bucket>.class
which throws me a syntax error . What is the correct way of doing this ?