Example usage for com.google.gson TypeAdapterFactory interface-usage

List of usage examples for com.google.gson TypeAdapterFactory interface-usage

Introduction

In this page you can find the example usage for com.google.gson TypeAdapterFactory interface-usage.

Usage

From source file org.eclipse.lsp4j.adapters.DocumentChangeListAdapter.java

public class DocumentChangeListAdapter implements TypeAdapterFactory {

    private static final TypeToken<Either<TextDocumentEdit, ResourceOperation>> ELEMENT_TYPE = new TypeToken<Either<TextDocumentEdit, ResourceOperation>>() {
    };

    @SuppressWarnings("unchecked")

From source file org.eclipse.lsp4j.adapters.DocumentSymbolResponseAdapter.java

public class DocumentSymbolResponseAdapter implements TypeAdapterFactory {

    private static final TypeToken<Either<SymbolInformation, DocumentSymbol>> ELEMENT_TYPE = new TypeToken<Either<SymbolInformation, DocumentSymbol>>() {
    };

    @SuppressWarnings("unchecked")

From source file org.eclipse.lsp4j.adapters.PrepareRenameResponseAdapter.java

public class PrepareRenameResponseAdapter implements TypeAdapterFactory {

    private static final TypeToken<Either<Range, PrepareRenameResult>> ELEMENT_TYPE = new TypeToken<Either<Range, PrepareRenameResult>>() {
    };

    @SuppressWarnings("unchecked")

From source file org.eclipse.lsp4j.adapters.ResourceChangeListAdapter.java

@SuppressWarnings("deprecation")
public class ResourceChangeListAdapter implements TypeAdapterFactory {

    private static final TypeToken<Either<ResourceChange, TextDocumentEdit>> ELEMENT_TYPE = new TypeToken<Either<ResourceChange, TextDocumentEdit>>() {
    };

From source file org.eclipse.lsp4j.adapters.ResourceOperationTypeAdapter.java

public class ResourceOperationTypeAdapter implements TypeAdapterFactory {

    @SuppressWarnings("unchecked")
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {

From source file org.eclipse.lsp4j.jsonrpc.json.adapters.CollectionTypeAdapterFactory.java

/**
 * A specialized type adapter factory for collections that can handle single values.
 */
public class CollectionTypeAdapterFactory implements TypeAdapterFactory {

    @Override

From source file org.eclipse.lsp4j.jsonrpc.json.adapters.EitherTypeAdapterFactory.java

/**
 * Type adapter factory for {@link Either} and {@link Either3}.
 */
public class EitherTypeAdapterFactory implements TypeAdapterFactory {

    @SuppressWarnings({ "rawtypes", "unchecked" })

From source file org.eclipse.lsp4j.jsonrpc.json.adapters.EnumTypeAdapterFactory.java

/**
 * A custom type adapter factory for enums that uses integer values.
 */
public class EnumTypeAdapterFactory implements TypeAdapterFactory {

    @Override

From source file org.eclipse.lsp4j.jsonrpc.json.adapters.MessageTypeAdapterFactory.java

/**
 * The type adapter for messages dispatches between the different message types: {@link RequestMessage},
 * {@link ResponseMessage}, and {@link NotificationMessage}.
 */
public class MessageTypeAdapterFactory implements TypeAdapterFactory {

From source file org.eclipse.recommenders.utils.gson.MultisetTypeAdapterFactory.java

public class MultisetTypeAdapterFactory implements TypeAdapterFactory {

    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
        Type type = typeToken.getType();
        if (typeToken.getRawType() != Multiset.class || !(type instanceof ParameterizedType)) {