summaryrefslogtreecommitdiffstats
path: root/dcaedt_be/src/main/java/org/onap/sdc/dcae/rule/editor/utils/EmptyStringTranslationSerializer.java
blob: c65076f918c2fe5ffe9311149f14e085078b7489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package org.onap.sdc.dcae.rule.editor.utils;

import com.google.gson.*;

import java.lang.reflect.Type;

public class EmptyStringTranslationSerializer implements JsonSerializer<String> {

	public JsonElement serialize(String src, Type typeOfSrc, JsonSerializationContext context) {
		if("\"\"".equals(src))
			return new JsonPrimitive("");
		return new JsonPrimitive(src);
	}
}