private Device extractDevice(final JsonDevice device) {
		final Map<ExtraMapping, String> extras = new EnumMap<>(ExtraMapping.class);
		final Set<String> keys = new HashSet<>(device.extra.keySet());
		for (final ExtraMapping extra : ExtraMapping.values()) {
			extras.put(extra, device.extra.get(extra.name()));

			if (keys.contains(extra.name())) {
				keys.remove(extra.name());
			} else {
				LOGGER.debug("\"extra\" missing key \"{}\": {}", extra.name(), device.extra.toString());
			}
		}
		for (final String key : keys) {
			LOGGER.debug("Unexpected key in \"extra\": {}", key);
		}

		return new Device(device, extras);
	}
private Device extractDevice ( final JsonDevice device ) { final Map < ExtraMapping , String > extras = new EnumMap < > ( ExtraMapping . class ) ; final Set < String > keys = new HashSet < > ( device . extra . keySet ( ) ) ; for ( final ExtraMapping extra : ExtraMapping . values ( ) ) { extras . put ( extra , device . extra . get ( extra . name ( ) ) ) ; if ( keys . contains ( extra . name ( ) ) ) { keys . remove ( extra . name ( ) ) ; } else { LOGGER . debug ( "\"extra\" missing key \"{}\": {}" , extra . name ( ) , device . extra . toString ( ) ) ; } } for ( final String key : keys ) { LOGGER . debug ( "Unexpected key in \"extra\": {}" , key ) ; } return new Device ( device , extras ) ; }
Converts the {@link JsonDevice} object into a {@link Device} and logs any missing/extra fields to debug.