io.getunleash.util.AtomicLongSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unleash-client-java Show documentation
Show all versions of unleash-client-java Show documentation
A client library for Unleash
package io.getunleash.util;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import java.lang.reflect.Type;
import java.util.concurrent.atomic.AtomicLong;
public class AtomicLongSerializer implements JsonSerializer {
@Override
public JsonElement serialize(AtomicLong src, Type typeOfSrc, JsonSerializationContext context) {
return new JsonPrimitive(src.get());
}
}