diff --git a/launchdarkly-android-client/src/main/java/com/launchdarkly/android/gson/EvaluationReasonSerialization.java b/launchdarkly-android-client/src/main/java/com/launchdarkly/android/gson/EvaluationReasonSerialization.java index 13c27f79..30818361 100644 --- a/launchdarkly-android-client/src/main/java/com/launchdarkly/android/gson/EvaluationReasonSerialization.java +++ b/launchdarkly-android-client/src/main/java/com/launchdarkly/android/gson/EvaluationReasonSerialization.java @@ -26,22 +26,7 @@ private static > T parseEnum(Class c, String name, T fallba @Override public JsonElement serialize(EvaluationReason src, Type typeOfSrc, JsonSerializationContext context) { - if (src instanceof EvaluationReason.Off) { - return context.serialize(src, EvaluationReason.Off.class); - } else if (src instanceof EvaluationReason.Fallthrough) { - return context.serialize(src, EvaluationReason.Fallthrough.class); - } else if (src instanceof EvaluationReason.TargetMatch) { - return context.serialize(src, EvaluationReason.TargetMatch.class); - } else if (src instanceof EvaluationReason.RuleMatch) { - return context.serialize(src, EvaluationReason.RuleMatch.class); - } else if (src instanceof EvaluationReason.PrerequisiteFailed) { - return context.serialize(src, EvaluationReason.PrerequisiteFailed.class); - } else if (src instanceof EvaluationReason.Error) { - return context.serialize(src, EvaluationReason.Error.class); - } else if (src instanceof EvaluationReason.Unknown) { - return context.serialize(src, EvaluationReason.Unknown.class); - } - return null; + return context.serialize(src, src.getClass()); } @Override