Code example for JsonPrimitive

0
				.getDevice()); 
		result.add(DEVICE_NAME_PROPERTY, new JsonPrimitive(deviceName));
		 
		if (!(src instanceof UnknownTopologyInterface))
			result.add(INTERFACE_NAME_PROPERTY,
					new JsonPrimitive(src.getName()));
		 
		return result;
	} 
	 
	@Override 
	public TopologyInterface deserialize(JsonElement json, Type typeOfT,
			JsonDeserializationContext context) throws JsonParseException {
		JsonObject object = json.getAsJsonObject();
		 
		JsonElement interfaceNameElement = object.get(INTERFACE_NAME_PROPERTY);
		 
		String deviceName = object.get(DEVICE_NAME_PROPERTY).getAsString();
		TopologyDevice topologyDevice = JsonTopologyAdapter
				.getDeserializedTopologyDevice(deviceName);
Contextual code suggestions in your IDE  Get Codota for Java