@Test void decode() throws Exception { final EndpointListDecoder<JsonNode> decoder = EndpointListDecoder.JSON; final List<Endpoint> decoded = decoder.decode( objectMapper.readTree(objectMapper.writeValueAsString(HOST_AND_PORT_LIST))); assertThat(decoded).hasSize(4); assertThat(decoded).isEqualTo(ENDPOINT_LIST); }
@Override public List<Endpoint> decode(JsonNode node) { final List<String> endpoints; try { endpoints = objectMapper.readValue(node.traverse(), new TypeReference<List<String>>() {}); } catch (IOException e) { throw new IllegalArgumentException("invalid format: " + node); } return convertToEndpointList(endpoints); }
JsonEndpointListDecoder implements EndpointListDecoder<JsonNode> { @Override public List<Endpoint> decode(JsonNode node) { final List<String> endpoints; try { endpoints = objectMapper.readValue(node.traverse(), new TypeReference<List<String>>() {}); } catch (IOException e) { throw new IllegalArgumentException("invalid format: " + node); } return convertToEndpointList(endpoints); } }
JsonEndpointListDecoder implements EndpointListDecoder<JsonNode> { @Override public List<Endpoint> decode(JsonNode node) { final List<String> endpoints; try { endpoints = objectMapper.readValue(node.traverse(), new TypeReference<List<String>>() {}); } catch (IOException e) { throw new IllegalArgumentException("invalid format: " + node); } return convertToEndpointList(endpoints); }  }
JsonEndpointListDecoder implements EndpointListDecoder<JsonNode> { @Override public List<Endpoint> decode(JsonNode node) { final List<String> endpoints; try { endpoints = objectMapper.readValue(node.traverse(), new TypeReference<List<String>>() {}); } catch (IOException e) { throw new IllegalArgumentException("invalid format: " + node); } return convertToEndpointList(endpoints); }  @Override List<Endpoint> decode(JsonNode node); }
JsonEndpointListDecoder implements EndpointListDecoder<JsonNode> { @Override public List<Endpoint> decode(JsonNode node) { final List<String> endpoints; try { endpoints = objectMapper.readValue(node.traverse(), new TypeReference<List<String>>() {}); } catch (IOException e) { throw new IllegalArgumentException("invalid format: " + node); } return convertToEndpointList(endpoints); }  @Override List<Endpoint> decode(JsonNode node);  }