Esempio n. 1
0
  public static void checkMediaFor(String client, Media media) {
    // required
    assertNotNull(media.getImageType(), String.format(OBJ_FIELD_REQ, client, "imageType"));
    checkImageType(media.getImageType());
    assertNotNull(media.getSize(), String.format(OBJ_FIELD_REQ, client, "size"));
    assertTrue(
        media.getSize() >= 0, String.format(OBJ_FIELD_GTE_0, client, "size", media.getSize()));

    // parent type
    checkResourceEntityType(media);
  }
Esempio n. 2
0
 public B fromMedia(Media in) {
   return fromResourceEntityType(in)
       .owner(in.getOwner())
       .imageType(in.getImageType())
       .size(in.getSize());
 }