Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Getter
- @JsonDeserialize(builder = Photo.Builder.class)
- @ApiModel(description = "The photo of the movie")
- public class Photo<T> extends MovieInfoDTO {
- private static final long serialVersionUID = -2888506993270867653L;
- @ApiModelProperty(notes = "The photo of the movie", required = true)
- private T photo;
- /**
- * Constructor only accessible via builder build() method.
- *
- * @param builder The builder to get data from
- */
- @SuppressWarnings("unchecked")
- private Photo(final Builder builder) {
- this.photo = (T) builder.bPhoto;
- }
- /**
- * A builder to create release dates.
- */
- public static class Builder<T> {
- private final T bPhoto;
- /**
- * Constructor which has required fields.
- *
- * @param photo The photo of the movie
- */
- @JsonCreator
- public Builder(
- @JsonProperty("photo") final T photo
- ) {
- this.bPhoto = photo;
- }
- /**
- * Build the PHOTO.
- *
- * @return Create the final read-only Photo instance
- */
- public Photo build() {
- return new Photo(this);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement