Advertisement
Guest User

photo

a guest
Jan 1st, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. @Getter
  2. @JsonDeserialize(builder = Photo.Builder.class)
  3. @ApiModel(description = "The photo of the movie")
  4. public class Photo<T> extends MovieInfoDTO {
  5.  
  6.     private static final long serialVersionUID = -2888506993270867653L;
  7.  
  8.     @ApiModelProperty(notes = "The photo of the movie", required = true)
  9.     private T photo;
  10.  
  11.     /**
  12.      * Constructor only accessible via builder build() method.
  13.      *
  14.      * @param builder The builder to get data from
  15.      */
  16.     @SuppressWarnings("unchecked")
  17.     private Photo(final Builder builder) {
  18.         this.photo = (T) builder.bPhoto;
  19.     }
  20.  
  21.     /**
  22.      * A builder to create release dates.
  23.      */
  24.     public static class Builder<T> {
  25.  
  26.         private final T bPhoto;
  27.  
  28.         /**
  29.          * Constructor which has required fields.
  30.          *
  31.          * @param photo The photo of the movie
  32.          */
  33.         @JsonCreator
  34.         public Builder(
  35.                 @JsonProperty("photo") final T photo
  36.         ) {
  37.             this.bPhoto = photo;
  38.         }
  39.  
  40.         /**
  41.          * Build the PHOTO.
  42.          *
  43.          * @return Create the final read-only Photo instance
  44.          */
  45.         public Photo build() {
  46.             return new Photo(this);
  47.         }
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement