src/main/java/edu/kit/informatik/pcc/webinterface/datamanagement/VideoDataManager.java
/**
     * This method parses the String and creates a list of Video Objects.
     *
     * @param videos the String which contains the videos
     */
This method parses the String and creates a list of Video Objects.
@param videos the String which contains the videos
This method parses the String and creates a list of Video Objects . @param videos the String which contains the videos
private static LinkedList<Video> createVideoList(String videos) {
        LinkedList<Video> videoList = new LinkedList<>();
        JSONArray jsonArray = new JSONArray(videos);
        for (int i = 0; i < jsonArray.length(); i++) {
            JSONObject jsonObject = jsonArray.getJSONObject(i);
            String name = jsonObject.getString("name");
            int id = jsonObject.getInt("id");
            Video video = new Video(name, id);
            videoList.add(video);
        }
        return videoList;
    }
private static LinkedList < Video > createVideoList ( String videos ) { LinkedList < Video > videoList = new LinkedList < > ( ) ; JSONArray jsonArray = new JSONArray ( videos ) ; for ( int i = 0 ; i < jsonArray . length ( ) ; i ++ ) { JSONObject jsonObject = jsonArray . getJSONObject ( i ) ; String name = jsonObject . getString ( "name" ) ; int id = jsonObject . getInt ( "id" ) ; Video video = new Video ( name , id ) ; videoList . add ( video ) ; } return videoList ; }
This method parses the String and creates a list of Video Objects.
This method parses the String and creates a list of Video Objects .