All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javastrava.json.impl.gson.serializer.ClubMembershipStatusSerializer Maven / Gradle / Ivy

There is a newer version: 1.0.3.6
Show newest version
package javastrava.json.impl.gson.serializer;

import java.lang.reflect.Type;

import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import javastrava.api.v3.model.reference.StravaClubMembershipStatus;

public class ClubMembershipStatusSerializer
		implements JsonSerializer, JsonDeserializer {

	@Override
	public StravaClubMembershipStatus deserialize(JsonElement json, Type type, JsonDeserializationContext context)
			throws JsonParseException {
		StravaClubMembershipStatus status = StravaClubMembershipStatus.create(json.getAsString());
		return status;
	}

	@Override
	public JsonElement serialize(StravaClubMembershipStatus status, Type type, JsonSerializationContext context) {
		return context.serialize(status.getValue());
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy