Code example for JsonPrimitive

0
public class JsonMACAddressAdapter extends JsonAdapter<MACAddress> { 
	 
	@Override 
	public JsonElement serialize(MACAddress src, Type typeOfSrc,
			JsonSerializationContext context) {
		return new JsonPrimitive(src.toColonedString());
	} 
	 
	@Override 
	public MACAddress deserialize(JsonElement json, Type typeOfT,
			JsonDeserializationContext context) throws JsonParseException {
		return new MACAddress(json.getAsJsonPrimitive().getAsString());
	} 
	 
}