
org.johnnei.enjin.internal.gson.GsonFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of enjin-api-impl Show documentation
Show all versions of enjin-api-impl Show documentation
The specification of the Enjin API
The newest version!
package org.johnnei.enjin.internal.gson;
import java.util.Optional;
import org.johnnei.enjin.internal.RequestWrapper;
import org.johnnei.enjin.spec.dto.Credentials;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
public class GsonFactory {
private GsonFactory() {
// Hide constructor as you don't need to create a utility class
}
public static Gson create() {
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Credentials.class, new CredentialsSerializer());
builder.registerTypeAdapter(Optional.class, new OptionalDeserializer());
builder.registerTypeAdapter(RequestWrapper.class, new RequestWrapperSerializer());
return builder.create();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy