public static <T> void notEmptyAndContainsNoNulls(Collection<T> container, String name) { Validate.containsNoNulls(container, name); Validate.notEmpty(container, name); }
public static <T> void notEmptyAndContainsNoNulls(Collection<T> container, String name) { Validate.containsNoNulls(container, name); Validate.notEmpty(container, name); }
/** * Adds a number of bitmap attachments associated with a native app call. The attachments will be * served via {@link NativeAppCallContentProvider#openFile(android.net.Uri, String) openFile}. * * @param context the Context the call is being made from * @param callId the unique ID of the call * @param imageAttachments a Map of attachment names to Bitmaps; the attachment names will be part of * the URI processed by openFile * @throws java.io.IOException */ public void addAttachmentsForCall(Context context, UUID callId, Map<String, Bitmap> imageAttachments) { Validate.notNull(context, "context"); Validate.notNull(callId, "callId"); Validate.containsNoNulls(imageAttachments.values(), "imageAttachments"); Validate.containsNoNullOrEmpty(imageAttachments.keySet(), "imageAttachments"); addAttachments(context, callId, imageAttachments, new ProcessAttachment<Bitmap>() { @Override public void processAttachment(Bitmap attachment, File outputFile) throws IOException { FileOutputStream outputStream = new FileOutputStream(outputFile); try { attachment.compress(Bitmap.CompressFormat.JPEG, 100, outputStream); } finally { Utility.closeQuietly(outputStream); } } }); }
Validate.notNull(context, "context"); Validate.notNull(callId, "callId"); Validate.containsNoNulls(imageAttachmentFiles.values(), "imageAttachmentFiles"); Validate.containsNoNullOrEmpty(imageAttachmentFiles.keySet(), "imageAttachmentFiles");
/** * <p>Specifies a list of images for the Open Graph action that should be uploaded prior to publishing the * action. The action must already have been set prior to calling this method. This method will generate unique * names for the image attachments and update the action to refer to these attachments. Note that calling * setAction again after calling this method will not clear the image attachments already set, but the new * action will have no reference to the existing attachments. The images may be marked as being * user-generated -- refer to * <a href="https://developers.facebook.com/docs/opengraph/howtos/adding-photos-to-stories/">this article</a> * for more information.</p> * <p/> * <p>In order for the images to be provided to the Facebook application as part of the app call, the * NativeAppCallContentProvider must be specified correctly in the application's AndroidManifest.xml.</p> * * @param bitmaps a list of Bitmaps to be uploaded and attached to the Open Graph action * @param isUserGenerated if true, specifies that the user_generated flag should be set for these images * @return this instance of the builder */ public CONCRETE setImageAttachmentsForAction(List<Bitmap> bitmaps, boolean isUserGenerated) { Validate.containsNoNulls(bitmaps, "bitmaps"); if (action == null) { throw new FacebookException("Can not set attachments prior to setting action."); } List<String> attachmentUrls = addImageAttachments(bitmaps); updateActionAttachmentUrls(attachmentUrls, isUserGenerated); @SuppressWarnings("unchecked") CONCRETE result = (CONCRETE) this; return result; }
/** * <p>Specifies a list of images for the Open Graph action that should be uploaded prior to publishing the * action. The action must already have been set prior to calling this method. The images may be marked as being * user-generated -- refer to * <a href="https://developers.facebook.com/docs/opengraph/howtos/adding-photos-to-stories/">this article</a> * for more information. This method will generate unique * names for the image attachments and update the action to refer to these attachments. Note that calling * setAction again after calling this method will not clear the image attachments already set, but the new * action will have no reference to the existing attachments.</p> * <p/> * <p>In order for the images to be provided to the Facebook application as part of the app call, the * NativeAppCallContentProvider must be specified correctly in the application's AndroidManifest.xml.</p> * * @param bitmapFiles a list of Files containing bitmaps to be uploaded and attached to the Open Graph action * @param isUserGenerated if true, specifies that the user_generated flag should be set for these images * @return this instance of the builder */ public CONCRETE setImageAttachmentFilesForAction(List<File> bitmapFiles, boolean isUserGenerated) { Validate.containsNoNulls(bitmapFiles, "bitmapFiles"); if (action == null) { throw new FacebookException("Can not set attachments prior to setting action."); } List<String> attachmentUrls = addImageAttachmentFiles(bitmapFiles); updateActionAttachmentUrls(attachmentUrls, isUserGenerated); @SuppressWarnings("unchecked") CONCRETE result = (CONCRETE) this; return result; }
List<File> bitmapFiles, boolean isUserGenerated) { Validate.notNull(objectProperty, "objectProperty"); Validate.containsNoNulls(bitmapFiles, "bitmapFiles"); if (action == null) { throw new FacebookException("Can not set attachments prior to setting action.");
boolean isUserGenerated) { Validate.notNull(objectProperty, "objectProperty"); Validate.containsNoNulls(bitmaps, "bitmaps"); if (action == null) { throw new FacebookException("Can not set attachments prior to setting action.");