class ServiceData {

    static ServiceData fromJsonString(final String jsonString) {
        if (jsonString == null || jsonString.isEmpty()) {
            throw new IllegalArgumentException("json string can not be null or empty");
        }

        final List<Endpoint> endpoints = new ArrayList<>();

        final JSONObject json = new JSONObject(jsonString);
        final JSONArray epList = json.getJSONArray("endpoints");
        for (int i = 0; i < epList.length(); i++) {
            endpoints.add(Endpoint.fromJson(epList.getJSONObject(i).toString()));
        }
        return new ServiceData(endpoints);
    }

    public  ServiceData();
      ServiceData(final List<Endpoint> endpointList);

}