java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 7770 path $.films[8].images.poster

huangapple 未分类评论50阅读模式
标题翻译

java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 7770 path $.films[8].images.poster

问题

我收到了错误消息:
java.lang.IllegalStateException: 预期是一个对象 (BEGIN_OBJECT),但是在第 1 行第 7770 列出现了一个数组 (BEGIN_ARRAY),路径为 $.films[8].images.poster
当我尝试返回一列电影时。应用程序在昨天测试时正常工作,但现在抛出此错误。自从我超过限制后,我没有更改过任何代码,只更改了 API 凭据。

MainActivity

public class MainActivity extends AppCompatActivity {
    // ...
}

API 服务

public interface MovieGluApi {
    @GET("filmsNowShowing/")
    Call<Film> getFilmNames();

    @GET("cinemasNearby/")
    Call<Cinema> getNearbyCinema();
}

电影模型

public class Film {
    // ...
}

JSON 响应 - Postman

{
    "films": [
        {
            "film_id": 3139,
            "imdb_id": 112641,
            "film_name": "Casino",
            // ...
        },
        {
            "film_id": 7257,
            "imdb_id": 80455,
            "film_name": "The Blues Brothers",
            // ...
        },
        {
            "film_id": 12486,
            "imdb_id": 94336,
            "film_name": "Withnail & I",
            // ...
        },
        // ...
    ],
    "status": {
        "count": 10,
        "state": "OK",
        "method": "filmsNowShowing",
        "message": null,
        // ...
    }
}

(注意:上述翻译中的部分代码和 JSON 结构已被省略。)

英文翻译

I am receiving the error
java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 7770 path $.films[8].images.poster
when I try to return a list of films. The application was working fine till yesterday when I came to test it, it now throws this error. I hadn't changed any of the code since only the API credentials since I went over the limit.

MainActivity

public class MainActivity extends AppCompatActivity {
    private TextView textViewResult;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        textViewResult = findViewById(R.id.text_view_result);

        OkHttpClient.Builder client = new OkHttpClient.Builder();
        client.addInterceptor(new Interceptor() {
            @Override
            public okhttp3.Response intercept(Chain chain) throws IOException {
                Request request = chain.request()
                        .newBuilder()
                        .addHeader(&quot;api-version&quot;, &quot;v200&quot;)
                        .addHeader(&quot;Authorization&quot;, &quot;*******************************&quot;)
                        .addHeader(&quot;client&quot;, &quot;***************&quot;)
                        .addHeader(&quot;x-api-key&quot;, &quot;********************************&quot;)
                        .addHeader(&quot;device-datetime&quot;, &quot;2018-09-14T08:30:17.360Z&quot;)
                        .addHeader(&quot;territory&quot;, &quot;UK&quot;)
                        .addHeader(&quot;Geolocation&quot;, &quot;52.4814;-1.8998&quot;)
                        .build();
                Log.d(&quot;djd&quot;, request.toString());
                return chain.proceed(request);
            }
        });
        Retrofit retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl(&quot;https://api-gate2.movieglu.com/&quot;)
                .client(client.build())
                .build();

        MovieGluApi movieGluApi = retrofit.create(MovieGluApi.class);
        Call&lt;Film&gt; filmCall = movieGluApi.getFilmNames();
        filmCall.enqueue(new Callback&lt;Film&gt;() {
            @Override
            public void onResponse(Call&lt;Film&gt; call,Response&lt;Film&gt; response) {
                if (!response.isSuccessful()){
                    textViewResult.setText(&quot;Code: &quot; + response.code());
                    Log.d(&quot;dfkjf&quot;, response.toString());
                    return;
                }

                assert response.body() != null;
                List&lt;Film&gt; films = response.body().getFilms();
                Log.d(&quot;dfkjf&quot;, response.toString());

                for (Film film : films){
                    String content = &quot;&quot;;
                    content += &quot;Film ID: &quot; + film.getFilmId() +&quot;\n&quot;;
                    content += &quot;IMDB ID: &quot; + film.getImdbId() +&quot;\n&quot;;
                    content += &quot;Film Name: &quot; + film.getFilmName() +&quot;\n\n&quot;;
                    Log.d(&quot;Film name&quot;, film.toString());
                    textViewResult.append(content);
                }
            }
            @Override
            public void onFailure(Call&lt;Film&gt; call, Throwable t) {
                textViewResult.setText(t.getMessage());
                Log.d(&quot;What is films&quot;, t.getMessage());
            }
        });
    }
}

API service

    @GET(&quot;filmsNowShowing/&quot;)
    Call&lt;Film&gt; getFilmNames();

    @GET(&quot;cinemasNearby/&quot;)
    Call &lt;Cinema&gt; getNearbyCinema();
}

Film Model

public class Film {

    @SerializedName(&quot;films&quot;)
    @Expose
    List&lt;Film&gt; films;

    public List&lt;Film&gt; getFilms() {
        Log.d(&quot;What is films&quot;, films.toString());
        return films;
    }


    @SerializedName(&quot;film_id&quot;)
    @Expose
    private Integer filmId;
    @SerializedName(&quot;imdb_id&quot;)
    @Expose
    private Integer imdbId;
    @SerializedName(&quot;film_name&quot;)
    @Expose
    private String filmName;
    @SerializedName(&quot;release_dates&quot;)
    @Expose
    private List&lt;ReleaseDate&gt; releaseDates = null;
    @SerializedName(&quot;age_rating&quot;)
    @Expose
    private List&lt;AgeRating&gt; ageRating = null;
    @SerializedName(&quot;film_trailer&quot;)
    @Expose
    private Object filmTrailer;
    @SerializedName(&quot;synopsis_long&quot;)
    @Expose
    private String synopsisLong;
    @SerializedName(&quot;images&quot;)
    @Expose
    private Images images;

    public Integer getFilmId() {
        return filmId;
    }

    public void setFilmId(Integer filmId) {
        this.filmId = filmId;
    }

    public Integer getImdbId() {
        return imdbId;
    }

    public void setImdbId(Integer imdbId) {
        this.imdbId = imdbId;
    }

    public String getFilmName() {
        return filmName;
    }

    public void setFilmName(String filmName) {
        this.filmName = filmName;
    }

    public List&lt;ReleaseDate&gt; getReleaseDates() {
        return releaseDates;
    }

    public void setReleaseDates(List&lt;ReleaseDate&gt; releaseDates) {
        this.releaseDates = releaseDates;
    }

    public List&lt;AgeRating&gt; getAgeRating() {
        return ageRating;
    }

    public void setAgeRating(List&lt;AgeRating&gt; ageRating) {
        this.ageRating = ageRating;
    }

    public Object getFilmTrailer() {
        return filmTrailer;
    }

    public void setFilmTrailer(Object filmTrailer) {
        this.filmTrailer = filmTrailer;
    }

    public String getSynopsisLong() {
        return synopsisLong;
    }

    public void setSynopsisLong(String synopsisLong) {
        this.synopsisLong = synopsisLong;
    }

    public Images getImages() {
        return images;
    }

    public void setImages(Images images) {
        this.images = images;
    }

}

JSON Response - Postman

{
    &quot;films&quot;: [
        {
            &quot;film_id&quot;: 3139,
            &quot;imdb_id&quot;: 112641,
            &quot;film_name&quot;: &quot;Casino&quot;,
            &quot;release_dates&quot;: [
                {
                    &quot;release_date&quot;: &quot;1995-11-28&quot;,
                    &quot;notes&quot;: &quot;GBR&quot;
                }
            ],
            &quot;age_rating&quot;: [
                {
                    &quot;rating&quot;: &quot;18 &quot;,
                    &quot;age_rating_image&quot;: &quot;https://assets.movieglu.com/age_rating_logos/uk/18.png&quot;,
                    &quot;age_advisory&quot;: &quot;strong violence&quot;
                }
            ],
            &quot;film_trailer&quot;: null,
            &quot;synopsis_long&quot;: &quot;Robert DeNiro, Sharon Stone and Joe Pesci star in director Martin Scorsese&#39;s riveting look at how blind ambition, white-hot passion and 24-karat greed toppled an empire. Las Vegas 1973 is the setting for this fact-based story about the Mob&#39;s multi-million dollar casino operation - where fortunes and lives were made and lost with a roll of the dice.&quot;,
            &quot;images&quot;: {
                &quot;poster&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;global&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/3139/003139h1.jpg&quot;,
                            &quot;width&quot;: 199,
                            &quot;height&quot;: 300
                        }
                    }
                }
            }
        },
        {
            &quot;film_id&quot;: 7257,
            &quot;imdb_id&quot;: 80455,
            &quot;film_name&quot;: &quot;The Blues Brothers&quot;,
            &quot;release_dates&quot;: [
                {
                    &quot;release_date&quot;: &quot;2009-07-24&quot;,
                    &quot;notes&quot;: &quot;GBR&quot;
                }
            ],
            &quot;age_rating&quot;: [
                {
                    &quot;rating&quot;: &quot;15 &quot;,
                    &quot;age_rating_image&quot;: &quot;https://assets.movieglu.com/age_rating_logos/uk/15.png&quot;,
                    &quot;age_advisory&quot;: &quot;&quot;
                }
            ],
            &quot;film_trailer&quot;: &quot;https://trailer.movieglu.com/7257_high.mp4&quot;,
            &quot;synopsis_long&quot;: &quot;Jake and Elwood Blues endeavor to raise $5,000 for their childhood parrish by putting their old band back together uand taking their show on the road. While touring, they manage to wreak havoc on the entire city of Chicago and much of the midwest.&quot;,
            &quot;images&quot;: {
                &quot;poster&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;UK&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/7257/GBR_007257h0.jpg&quot;,
                            &quot;width&quot;: 200,
                            &quot;height&quot;: 300
                        }
                    },
                    &quot;2&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;global&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/7257/AUS_007257h0.jpg&quot;,
                            &quot;width&quot;: 164,
                            &quot;height&quot;: 300
                        }
                    }
                }
            }
        },
        {
            &quot;film_id&quot;: 12486,
            &quot;imdb_id&quot;: 94336,
            &quot;film_name&quot;: &quot;Withnail &amp; I&quot;,
            &quot;release_dates&quot;: [
                {
                    &quot;release_date&quot;: &quot;2007-09-07&quot;,
                    &quot;notes&quot;: &quot;GBR&quot;
                }
            ],
            &quot;age_rating&quot;: [
                {
                    &quot;rating&quot;: &quot;15 &quot;,
                    &quot;age_rating_image&quot;: &quot;https://assets.movieglu.com/age_rating_logos/uk/15.png&quot;,
                    &quot;age_advisory&quot;: &quot;&quot;
                }
            ],
            &quot;film_trailer&quot;: null,
            &quot;synopsis_long&quot;: &quot;&quot;,
            &quot;images&quot;: {
                &quot;poster&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;UK&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/12486/GBR_012486h0.jpg&quot;,
                            &quot;width&quot;: 200,
                            &quot;height&quot;: 300
                        }
                    }
                }
            }
        },
        {
            &quot;film_id&quot;: 279925,
            &quot;imdb_id&quot;: 7549996,
            &quot;film_name&quot;: &quot;Judy&quot;,
            &quot;release_dates&quot;: [
                {
                    &quot;release_date&quot;: &quot;2019-10-04&quot;,
                    &quot;notes&quot;: &quot;GBR&quot;
                }
            ],
            &quot;age_rating&quot;: [
                {
                    &quot;rating&quot;: &quot;12A &quot;,
                    &quot;age_rating_image&quot;: &quot;https://assets.movieglu.com/age_rating_logos/uk/12a.png&quot;,
                    &quot;age_advisory&quot;: &quot;scenes of drug misuse, infrequent strong language&quot;
                }
            ],
            &quot;film_trailer&quot;: &quot;https://trailer.movieglu.com/279925_uk_high_V3.mp4&quot;,
            &quot;synopsis_long&quot;: &quot;Winter 1968 and showbiz legend Judy Garland arrives in Swinging London to perform a five-week sold-out run at The Talk of the Town. It is 30 years since she shot to global stardom in The Wizard of Oz, but if her voice has weakened, its dramatic intensity has only grown. As she prepares for the show, battles with management, charms musicians and reminisces with friends and adoring fans, her wit and warmth shine through. Even her dreams of love seem undimmed as she embarks on a whirlwind romance with Mickey Deans, her soon-to-be fifth husband. Featuring some of her best-known songs, the film celebrates the voice, the capacity for love, and the sheer pizzazz of \&quot;the world&#39;s greatest entertainer.\&quot;&quot;,
            &quot;images&quot;: {
                &quot;poster&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;UK&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/279925/GBR_279925h0.jpg&quot;,
                            &quot;width&quot;: 202,
                            &quot;height&quot;: 300
                        }
                    }
                },
                &quot;still&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;landscape&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/279925/279925h2.jpg&quot;,
                            &quot;width&quot;: 300,
                            &quot;height&quot;: 200
                        }
                    }
                }
            }
        },
        {
            &quot;film_id&quot;: 80849,
            &quot;imdb_id&quot;: 77631,
            &quot;film_name&quot;: &quot;Grease Sing-A-Long&quot;,
            &quot;release_dates&quot;: [
                {
                    &quot;release_date&quot;: &quot;2010-07-13&quot;,
                    &quot;notes&quot;: &quot;GBR&quot;
                }
            ],
            &quot;age_rating&quot;: [
                {
                    &quot;rating&quot;: &quot;PG &quot;,
                    &quot;age_rating_image&quot;: &quot;https://assets.movieglu.com/age_rating_logos/uk/pg.png&quot;,
                    &quot;age_advisory&quot;: &quot;&quot;
                }
            ],
            &quot;film_trailer&quot;: null,
            &quot;synopsis_long&quot;: &quot;Rydell High&#39;s most famous graduating class is going back to school. A newly restored print brings the highest-grossing musical of all time, \&quot;Grease\&quot; (1978), to the big screen as a sing-along. Join Danny and Sandy with your own crew of T-Birds and Pink Ladies for a carnival ride back to those amazing summer nights!&quot;,
            &quot;images&quot;: {
                &quot;poster&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;global&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/80849/080849h1.jpg&quot;,
                            &quot;width&quot;: 200,
                            &quot;height&quot;: 300
                        }
                    }
                },
                &quot;still&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;landscape&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/80849/080849h2.jpg&quot;,
                            &quot;width&quot;: 300,
                            &quot;height&quot;: 200
                        }
                    }
                }
            }
        },
        {
            &quot;film_id&quot;: 281047,
            &quot;imdb_id&quot;: 7715070,
            &quot;film_name&quot;: &quot;Horrible Histories: The Movie&quot;,
            &quot;release_dates&quot;: [
                {
                    &quot;release_date&quot;: &quot;2019-07-26&quot;,
                    &quot;notes&quot;: &quot;GBR&quot;
                }
            ],
            &quot;age_rating&quot;: [
                {
                    &quot;rating&quot;: &quot;PG &quot;,
                    &quot;age_rating_image&quot;: &quot;https://assets.movieglu.com/age_rating_logos/uk/pg.png&quot;,
                    &quot;age_advisory&quot;: &quot;mild comic violence, injury detail, rude humour, language&quot;
                }
            ],
            &quot;film_trailer&quot;: &quot;https://trailer.movieglu.com/281047_uk_high.mp4&quot;,
            &quot;synopsis_long&quot;: &quot;Friends, Romans, Celts lend us your ears. The all-conquering Romans rule the civilised world and that includes the stain that is Britain. While the young Emperor Nero must battle his scheming mother Agrippina for ultimate power, Celt queen Boudicca gathers an army in Britain to repel the rotten Romans. Mixed up in this battle for liberation are the teenage Atti, a reluctant Roman soldier, and Orla, a young Celt with dreams of becoming a warrior like Boudicca. Will they fall on opposite sides or forge a friendship in the chaos of Celtic-inspired rebellion?&quot;,
            &quot;images&quot;: {
                &quot;poster&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;UK&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/281047/GBR_281047h0.jpg&quot;,
                            &quot;width&quot;: 200,
                            &quot;height&quot;: 300
                        }
                    }
                },
                &quot;still&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;landscape&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/281047/281047h2.jpg&quot;,
                            &quot;width&quot;: 300,
                            &quot;height&quot;: 200
                        }
                    }
                }
            }
        },
        {
            &quot;film_id&quot;: 2129,
            &quot;imdb_id&quot;: 45152,
            &quot;film_name&quot;: &quot;Singin&#39; in the Rain&quot;,
            &quot;release_dates&quot;: [
                {
                    &quot;release_date&quot;: &quot;2019-10-18&quot;,
                    &quot;notes&quot;: &quot;GBR&quot;
                }
            ],
            &quot;age_rating&quot;: [
                {
                    &quot;rating&quot;: &quot;U &quot;,
                    &quot;age_rating_image&quot;: &quot;https://assets.movieglu.com/age_rating_logos/uk/u.png&quot;,
                    &quot;age_advisory&quot;: &quot;very mild comic violence&quot;
                }
            ],
            &quot;film_trailer&quot;: &quot;https://trailer.movieglu.com/2129_high.mp4&quot;,
            &quot;synopsis_long&quot;: &quot;Gene Kelly, Debbie Reynolds and Donald O&#39;Connor star in Singin&#39; in the Rain, one of the greatest and most successful musicals ever filmed - filled with memorable songs, lavish routines and Kelly&#39;s fabulous song-and-dance number performed in the rain.\n\nSet during the advent of \&quot;talkies,\&quot; Don Lockwood  has risen to stardom during Hollywood&#39;s silent-movie era - paired with the beautiful, jealous and dumb Lina Lamont. And when Lockwood becomes attracted to young studio singer Kathy Selden, Lamont has her fired.\n\nBut with the introduction of talking pictures, Lockwood finds his career in jeopardy after audiences laugh when they hear Lamont speak in her shrill voice for the first time... until the studio decides to use Selden to dub her voice.&quot;,
            &quot;images&quot;: {
                &quot;poster&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;UK&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/2129/GBR_002129h0.jpg&quot;,
                            &quot;width&quot;: 200,
                            &quot;height&quot;: 300
                        }
                    },
                    &quot;2&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;global&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/2129/AUS_002129h0.jpg&quot;,
                            &quot;width&quot;: 220,
                            &quot;height&quot;: 300
                        }
                    }
                },
                &quot;still&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;landscape&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/2129/002129h2.jpg&quot;,
                            &quot;width&quot;: 300,
                            &quot;height&quot;: 200
                        }
                    }
                }
            }
        },
        {
            &quot;film_id&quot;: 6548,
            &quot;imdb_id&quot;: 38669,
            &quot;film_name&quot;: &quot;The Killers (1946)&quot;,
            &quot;release_dates&quot;: [
                {
                    &quot;release_date&quot;: &quot;1946-09-16&quot;,
                    &quot;notes&quot;: &quot;GBR&quot;
                }
            ],
            &quot;age_rating&quot;: [
                {
                    &quot;rating&quot;: &quot;PG &quot;,
                    &quot;age_rating_image&quot;: &quot;https://assets.movieglu.com/age_rating_logos/uk/pg.png&quot;,
                    &quot;age_advisory&quot;: &quot;&quot;
                }
            ],
            &quot;film_trailer&quot;: null,
            &quot;synopsis_long&quot;: &quot;&quot;,
            &quot;images&quot;: {
                &quot;poster&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;UK&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/6548/GBR_006548h0.jpg&quot;,
                            &quot;width&quot;: 200,
                            &quot;height&quot;: 300
                        }
                    }
                }
            }
        },
        {
            &quot;film_id&quot;: 4705,
            &quot;imdb_id&quot;: 96928,
            &quot;film_name&quot;: &quot;Bill &amp; Ted&#39;s Excellent Adventure&quot;,
            &quot;release_dates&quot;: [
                {
                    &quot;release_date&quot;: &quot;1989-08-25&quot;,
                    &quot;notes&quot;: &quot;GBR&quot;
                }
            ],
            &quot;age_rating&quot;: [
                {
                    &quot;rating&quot;: &quot;PG &quot;,
                    &quot;age_rating_image&quot;: &quot;https://assets.movieglu.com/age_rating_logos/uk/pg.png&quot;,
                    &quot;age_advisory&quot;: &quot;Contains mild language and violence&quot;
                }
            ],
            &quot;film_trailer&quot;: null,
            &quot;synopsis_long&quot;: &quot;Bill Preston and Ted Logan are two totally excellent dudes facing one most heinous history exam. With the help of Rufus an ultra-cool messenger in a time traveling phone booth, the triumphant two-some bag a bevy of historical heavy weights like the \&quot;Bodacious Philosopher Socrates, \&quot;One Very Excellent Barbarian\&quot; Genghis Khan, the \&quot;Short Dead Dude\&quot; Napoleon and Noah&#39;s Wife Joan of Arc to stage the most hysterical high school project ever. History&#39;s about to be rewritten by two guys who can&#39;t even spell.&quot;,
            &quot;images&quot;: {
                &quot;poster&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;UK&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/4705/GBR_004705h0.jpg&quot;,
                            &quot;width&quot;: 200,
                            &quot;height&quot;: 300
                        }
                    }
                }
            }
        },
        {
            &quot;film_id&quot;: 3855,
            &quot;imdb_id&quot;: 93191,
            &quot;film_name&quot;: &quot;Wings of Desire&quot;,
            &quot;release_dates&quot;: [
                {
                    &quot;release_date&quot;: &quot;1990-10-01&quot;,
                    &quot;notes&quot;: &quot;GBR&quot;
                }
            ],
            &quot;age_rating&quot;: [
                {
                    &quot;rating&quot;: &quot;12 &quot;,
                    &quot;age_rating_image&quot;: &quot;https://assets.movieglu.com/age_rating_logos/uk/12.png&quot;,
                    &quot;age_advisory&quot;: &quot;Contains one use of strong language&quot;
                }
            ],
            &quot;film_trailer&quot;: null,
            &quot;synopsis_long&quot;: &quot;\&quot;Wings of Desire\&quot; is one of cinema&#39;s loveliest city symphonies. Bruno Ganz is Damiel, an angel perched atop buildings high over Berlin who can hear the thoughts fears, hopes, dreams of all the people living below. But when he falls in love with a beautiful trapeze artist, he is willing to give up his immortality and come back to earth to be with her. Made not long before the fall of the Berlin wall, this stunning tapestry of sounds and images, shot in black and white and color by the legendary Henri Alekan, is movie poetry. And it forever made the name Wim Wenders synonymous with film art.&quot;,
            &quot;images&quot;: {
                &quot;poster&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;portrait&quot;,
                        &quot;region&quot;: &quot;UK&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/3855/GBR_003855h0.jpg&quot;,
                            &quot;width&quot;: 200,
                            &quot;height&quot;: 300
                        }
                    }
                },
                &quot;still&quot;: {
                    &quot;1&quot;: {
                        &quot;image_orientation&quot;: &quot;landscape&quot;,
                        &quot;medium&quot;: {
                            &quot;film_image&quot;: &quot;https://image.movieglu.com/3855/003855h2.jpg&quot;,
                            &quot;width&quot;: 300,
                            &quot;height&quot;: 200
                        }
                    }
                }
            }
        }
    ],
    &quot;status&quot;: {
        &quot;count&quot;: 10,
        &quot;state&quot;: &quot;OK&quot;,
        &quot;method&quot;: &quot;filmsNowShowing&quot;,
        &quot;message&quot;: null,
        &quot;request_method&quot;: &quot;GET&quot;,
        &quot;version&quot;: &quot;WALS_2v200&quot;,
        &quot;territory&quot;: &quot;UK&quot;,
        &quot;device_datetime_sent&quot;: &quot;2020-05-17T08:30:17.360Z&quot;,
        &quot;device_datetime_used&quot;: &quot;2020-05-17 08:30:17&quot;
    }
}

答案1

得分: 0

以下是翻译好的部分:

使用这些Pogo类并运行您的代码

package ;
public class Release_dates
{
    private DateTime release_date;

    private String notes;

    public void setRelease_date(DateTime release_date){
        this.release_date = release_date;
    }
    public DateTime getRelease_date(){
        return this.release_date;
    }
    public void setNotes(String notes){
        this.notes = notes;
    }
    public String getNotes(){
        return this.notes;
    }
}

package ;
public class Age_rating
{
    private String rating;

    private String age_rating_image;

    private String age_advisory;

    public void setRating(String rating){
        this.rating = rating;
    }
    public String getRating(){
        return this.rating;
    }
    public void setAge_rating_image(String age_rating_image){
        this.age_rating_image = age_rating_image;
    }
    public String getAge_rating_image(){
        return this.age_rating_image;
    }
    public void setAge_advisory(String age_advisory){
        this.age_advisory = age_advisory;
    }
    public String getAge_advisory(){
        return this.age_advisory;
    }
}

package ;
public class Medium
{
    private String film_image;

    private int width;

    private int height;

    public void setFilm_image(String film_image){
        this.film_image = film_image;
    }
    public String getFilm_image(){
        return this.film_image;
    }
    public void setWidth(int width){
        this.width = width;
    }
    public int getWidth(){
        return this.width;
    }
    public void setHeight(int height){
        this.height = height;
    }
    public int getHeight(){
        return this.height;
    }
}

package ;
public class 1
{
    private String image_orientation;

    private String region;

    private Medium medium;

    public void setImage_orientation(String image_orientation){
        this.image_orientation = image_orientation;
    }
    public String getImage_orientation(){
        return this.image_orientation;
    }
    public void setRegion(String region){
        this.region = region;
    }
    public String getRegion(){
        return this.region;
    }
    public void setMedium(Medium medium){
        this.medium = medium;
    }
    public Medium getMedium(){
        return this.medium;
    }
}

package ;
public class Poster
{
    private 1 1;

    public void set1(1 1){
        this.1 = 1;
    }
    public 1 get1(){
        return this.1;
    }
}

package ;
public class Images
{
    private Poster poster;

    public void setPoster(Poster poster){
        this.poster = poster;
    }
    public Poster getPoster(){
        return this.poster;
    }
}

package ;
import java.util.ArrayList;
import java.util.List;
public class Films
{
    private int film_id;

    private int imdb_id;

    private String film_name;

    private List&lt;Release_dates&gt; release_dates;

    private List&lt;Age_rating&gt; age_rating;

    private String film_trailer;

    private String synopsis_long;

    private Images images;

    public void setFilm_id(int film_id){
        this.film_id = film_id;
    }
    public int getFilm_id(){
        return this.film_id;
    }
    public void setImdb_id(int imdb_id){
        this.imdb_id = imdb_id;
    }
    public int getImdb_id(){
        return this.imdb_id;
    }
    public void setFilm_name(String film_name){
        this.film_name = film_name;
    }
    public String getFilm_name(){
        return this.film_name;
    }
    public void setRelease_dates(List&lt;Release_dates&gt; release_dates){
        this.release_dates = release_dates;
    }
    public List&lt;Release_dates&gt; getRelease_dates(){
        return this.release_dates;
    }
    public void setAge_rating(List&lt;Age_rating&gt; age_rating){
        this.age_rating = age_rating;
    }
    public List&lt;Age_rating&gt; getAge_rating(){
        return this.age_rating;
    }
    public void setFilm_trailer(String film_trailer){
        this.film_trailer = film_trailer;
    }
    public String getFilm_trailer(){
        return this.film_trailer;
    }
    public void setSynopsis_long(String synopsis_long){
        this.synopsis_long = synopsis_long;
    }
    public String getSynopsis_long(){
        return this.synopsis_long;
    }
    public void setImages(Images images){
        this.images = images;
    }
    public Images getImages(){
        return this.images;
    }
}

package ;
public class Status
{
    private int count;

    private String state;

    private String method;

    private String message;

    private String request_method;

    private String version;

    private String territory;

    private String device_datetime_sent;

    private DateTime device_datetime_used;

    public void setCount(int count){
        this.count = count;
    }
    public int getCount(){
        return this.count;
    }
    public void setState(String state){
        this.state = state;
    }
    public String getState(){
        return this.state;
    }
    public void setMethod(String method){
        this.method = method;
    }
    public String getMethod(){
        return this.method;
    }
    public void setMessage(String message){
        this.message = message;
    }
    public String getMessage(){
        return this.message;
    }
    public void setRequest_method(String request_method){
        this.request_method = request_method;
    }
    public String getRequest_method(){
        return this.request_method;
    }
    public void setVersion(String version){
        this.version = version;
    }
    public String getVersion(){
        return this.version;
    }
    public void setTerritory(String territory){
        this.territory = territory;
    }
    public String getTerritory(){
        return this.territory;
    }
    public void setDevice_datetime_sent(String device_datetime_sent){
        this.device_datetime_sent = device_datetime_sent;
    }
    public String getDevice_datetime_sent(){
        return this.device_datetime_sent;
    }
    public void setDevice_datetime_used(DateTime device_datetime_used){
        this.device_datetime_used = device_datetime_used;
    }
    public DateTime getDevice_datetime_used(){
        return this.device_datetime_used;
    }
}

package ;
import java.util.ArrayList;
import java.util.List;
public class Root
{
    private List&lt;Films&gt; films;

    private Status status;

    public void setFilms(List&lt;Films&gt; films){
        this.films = films;
    }
    public List&lt;Films&gt; getFilms(){
        return this.films;
    }
    public void setStatus(Status status){
        this.status = status;
    }
    public Status getStatus(){
        return this.status;
    }
}
英文翻译

use these pogo classes and run your code

==================================
package ;
public class Release_dates
{
    private DateTime release_date;

    private String notes;

    public void setRelease_date(DateTime release_date){
        this.release_date = release_date;
    }
    public DateTime getRelease_date(){
        return this.release_date;
    }
    public void setNotes(String notes){
        this.notes = notes;
    }
    public String getNotes(){
        return this.notes;
    }
}

==================================
package ;
public class Age_rating
{
    private String rating;

    private String age_rating_image;

    private String age_advisory;

    public void setRating(String rating){
        this.rating = rating;
    }
    public String getRating(){
        return this.rating;
    }
    public void setAge_rating_image(String age_rating_image){
        this.age_rating_image = age_rating_image;
    }
    public String getAge_rating_image(){
        return this.age_rating_image;
    }
    public void setAge_advisory(String age_advisory){
        this.age_advisory = age_advisory;
    }
    public String getAge_advisory(){
        return this.age_advisory;
    }
}

==================================
package ;
public class Medium
{
    private String film_image;

    private int width;

    private int height;

    public void setFilm_image(String film_image){
        this.film_image = film_image;
    }
    public String getFilm_image(){
        return this.film_image;
    }
    public void setWidth(int width){
        this.width = width;
    }
    public int getWidth(){
        return this.width;
    }
    public void setHeight(int height){
        this.height = height;
    }
    public int getHeight(){
        return this.height;
    }
}

==================================
package ;
public class 1
{
    private String image_orientation;

    private String region;

    private Medium medium;

    public void setImage_orientation(String image_orientation){
        this.image_orientation = image_orientation;
    }
    public String getImage_orientation(){
        return this.image_orientation;
    }
    public void setRegion(String region){
        this.region = region;
    }
    public String getRegion(){
        return this.region;
    }
    public void setMedium(Medium medium){
        this.medium = medium;
    }
    public Medium getMedium(){
        return this.medium;
    }
}

==================================
package ;
public class Poster
{
    private 1 1;

    public void set1(1 1){
        this.1 = 1;
    }
    public 1 get1(){
        return this.1;
    }
}

==================================
package ;
public class Images
{
    private Poster poster;

    public void setPoster(Poster poster){
        this.poster = poster;
    }
    public Poster getPoster(){
        return this.poster;
    }
}

==================================
package ;
import java.util.ArrayList;
import java.util.List;
public class Films
{
    private int film_id;

    private int imdb_id;

    private String film_name;

    private List&lt;Release_dates&gt; release_dates;

    private List&lt;Age_rating&gt; age_rating;

    private String film_trailer;

    private String synopsis_long;

    private Images images;

    public void setFilm_id(int film_id){
        this.film_id = film_id;
    }
    public int getFilm_id(){
        return this.film_id;
    }
    public void setImdb_id(int imdb_id){
        this.imdb_id = imdb_id;
    }
    public int getImdb_id(){
        return this.imdb_id;
    }
    public void setFilm_name(String film_name){
        this.film_name = film_name;
    }
    public String getFilm_name(){
        return this.film_name;
    }
    public void setRelease_dates(List&lt;Release_dates&gt; release_dates){
        this.release_dates = release_dates;
    }
    public List&lt;Release_dates&gt; getRelease_dates(){
        return this.release_dates;
    }
    public void setAge_rating(List&lt;Age_rating&gt; age_rating){
        this.age_rating = age_rating;
    }
    public List&lt;Age_rating&gt; getAge_rating(){
        return this.age_rating;
    }
    public void setFilm_trailer(String film_trailer){
        this.film_trailer = film_trailer;
    }
    public String getFilm_trailer(){
        return this.film_trailer;
    }
    public void setSynopsis_long(String synopsis_long){
        this.synopsis_long = synopsis_long;
    }
    public String getSynopsis_long(){
        return this.synopsis_long;
    }
    public void setImages(Images images){
        this.images = images;
    }
    public Images getImages(){
        return this.images;
    }
}

==================================
package ;
public class Status
{
    private int count;

    private String state;

    private String method;

    private String message;

    private String request_method;

    private String version;

    private String territory;

    private String device_datetime_sent;

    private DateTime device_datetime_used;

    public void setCount(int count){
        this.count = count;
    }
    public int getCount(){
        return this.count;
    }
    public void setState(String state){
        this.state = state;
    }
    public String getState(){
        return this.state;
    }
    public void setMethod(String method){
        this.method = method;
    }
    public String getMethod(){
        return this.method;
    }
    public void setMessage(String message){
        this.message = message;
    }
    public String getMessage(){
        return this.message;
    }
    public void setRequest_method(String request_method){
        this.request_method = request_method;
    }
    public String getRequest_method(){
        return this.request_method;
    }
    public void setVersion(String version){
        this.version = version;
    }
    public String getVersion(){
        return this.version;
    }
    public void setTerritory(String territory){
        this.territory = territory;
    }
    public String getTerritory(){
        return this.territory;
    }
    public void setDevice_datetime_sent(String device_datetime_sent){
        this.device_datetime_sent = device_datetime_sent;
    }
    public String getDevice_datetime_sent(){
        return this.device_datetime_sent;
    }
    public void setDevice_datetime_used(DateTime device_datetime_used){
        this.device_datetime_used = device_datetime_used;
    }
    public DateTime getDevice_datetime_used(){
        return this.device_datetime_used;
    }
}

==================================
package ;
import java.util.ArrayList;
import java.util.List;
public class Root
{
    private List&lt;Films&gt; films;

    private Status status;

    public void setFilms(List&lt;Films&gt; films){
        this.films = films;
    }
    public List&lt;Films&gt; getFilms(){
        return this.films;
    }
    public void setStatus(Status status){
        this.status = status;
    }
    public Status getStatus(){
        return this.status;
    }
}

huangapple
  • 本文由 发表于 2020年5月31日 04:17:02
  • 转载请务必保留本文链接:https://java.coder-hub.com/62108176.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定