
org.johnnei.enjin.internal.gson.CredentialsSerializer 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.lang.reflect.Type;
import org.johnnei.enjin.spec.dto.Credentials;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
public class CredentialsSerializer implements JsonSerializer {
@Override
public JsonElement serialize(Credentials src, Type typeOfSrc, JsonSerializationContext context) {
JsonObject obj = new JsonObject();
obj.addProperty("email", src.getEmail());
obj.addProperty("password", new String(src.getPassword()));
return obj;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy