/** * Checks whether a batch entry is a success report. * * This method is a shortcut for checking the code of * the entry's {@link BatchStatus} object. * * @param entry * @return true if the entry is a success report. * @exception IllegalArgumentException if the entry does not contain * a BatchStatus object. */ public static boolean isSuccess(IEntry entry) { int code = getRequiredBatchStatusCode(entry); return code >= 200 && code < 300; }
/** * Checks whether a batch entry is an error report. * * This method is a shortcut for checking the code of * the entry's {@link BatchStatus} object. * * You'll want to call {@link #getStatus(IEntry)} * to get the error description and message when this * method returns true. * * @param entry * @return true if the entry is an error report. * @exception IllegalArgumentException if the entry does not contain * a BatchStatus object. */ public static boolean isFailure(IEntry entry) { return !isSuccess(entry); }
/** * Sets the batch operation to execute in a {@link BaseFeed}. * * @param feed * @param op batch operation type or null to remove it. */ public static void setBatchOperationType(IFeed feed, BatchOperationType op) { if (feed instanceof Element) { setBatchOperationType((Element) feed, op); } else { com.google.gdata.data.batch.BatchUtils.setBatchOperationType( (ExtensionPoint) feed, op); } }
/** * Gets the batch operation type from the tag {@code <batch:operation>} * in a {@link BaseFeed}. * * @return the operation to execute or null if it's not set * @param feed */ public static BatchOperationType getBatchOperationType(IFeed feed) { if (feed instanceof Element) { return getBatchOperationType((Element) feed); } else { return com.google.gdata.data.batch.BatchUtils.getBatchOperationType( (ExtensionPoint) feed); } }
private static int getRequiredBatchStatusCode(IEntry entry) { IBatchStatus batchStatus = getStatus(entry); if (batchStatus == null) { throw new IllegalArgumentException("Not a batch response entry; " + "Missing BatchStatus extension."); } return batchStatus.getCode(); }
BatchUtils.throwIfInterrupted(resultFeed); return resultFeed;
/** * Sets the batch operation to execute in a {@link BaseFeed}. * * @param feed * @param op batch operation type or null to remove it. */ public static void setBatchOperationType(IFeed feed, BatchOperationType op) { if (feed instanceof Element) { setBatchOperationType((Element) feed, op); } else { com.google.gdata.data.batch.BatchUtils.setBatchOperationType( (ExtensionPoint) feed, op); } }
/** * Gets the batch operation type from the tag {@code <batch:operation>} * in a {@link IEntry}. * * @param entry the entry to get the operation type from * @return the operation to execute or null if it's not set */ public static BatchOperationType getBatchOperationType(IEntry entry) { if (entry instanceof Element) { return getBatchOperationType((Element) entry); } else { return com.google.gdata.data.batch.BatchUtils.getBatchOperationType( (ExtensionPoint) entry); } }
private static int getRequiredBatchStatusCode(IEntry entry) { IBatchStatus batchStatus = getStatus(entry); if (batchStatus == null) { throw new IllegalArgumentException("Not a batch response entry; " + "Missing BatchStatus extension."); } return batchStatus.getCode(); }
BatchUtils.throwIfInterrupted(resultFeed); return resultFeed;
/** * Sets the batch operation to execute in a {@link BaseFeed}. * * @param feed * @param op batch operation type or null to remove it. */ public static void setBatchOperationType(IFeed feed, BatchOperationType op) { if (feed instanceof Element) { setBatchOperationType((Element) feed, op); } else { com.google.gdata.data.batch.BatchUtils.setBatchOperationType( (ExtensionPoint) feed, op); } }
/** * Gets the batch operation type from the tag {@code <batch:operation>} * in a {@link BaseFeed}. * * @return the operation to execute or null if it's not set * @param feed */ public static BatchOperationType getBatchOperationType(IFeed feed) { if (feed instanceof Element) { return getBatchOperationType((Element) feed); } else { return com.google.gdata.data.batch.BatchUtils.getBatchOperationType( (ExtensionPoint) feed); } }
private static int getRequiredBatchStatusCode(IEntry entry) { IBatchStatus batchStatus = getStatus(entry); if (batchStatus == null) { throw new IllegalArgumentException("Not a batch response entry; " + "Missing BatchStatus extension."); } return batchStatus.getCode(); }
/** * Checks whether a batch entry is a success report. * * This method is a shortcut for checking the code of * the entry's {@link BatchStatus} object. * * @param entry * @return true if the entry is a success report. * @exception IllegalArgumentException if the entry does not contain * a BatchStatus object. */ public static boolean isSuccess(IEntry entry) { int code = getRequiredBatchStatusCode(entry); return code >= 200 && code < 300; }
/** * Checks whether a batch entry is an error report. * * This method is a shortcut for checking the code of * the entry's {@link BatchStatus} object. * * You'll want to call {@link #getStatus(IEntry)} * to get the error description and message when this * method returns true. * * @param entry * @return true if the entry is an error report. * @exception IllegalArgumentException if the entry does not contain * a BatchStatus object. */ public static boolean isFailure(IEntry entry) { return !isSuccess(entry); }
BatchUtils.throwIfInterrupted(resultFeed); return resultFeed;
/** * Sets the batch operation to execute in a {@link IEntry}. * * @param entry the entry to set the operation type on * @param op batch operation type or null to remove it */ public static void setBatchOperationType(IEntry entry, BatchOperationType op) { if (entry instanceof Element) { setBatchOperationType((Element) entry, op); } else { com.google.gdata.data.batch.BatchUtils.setBatchOperationType( (ExtensionPoint) entry, op); } }
/** * Gets the batch operation type from the tag {@code <batch:operation>} * in a {@link BaseFeed}. * * @return the operation to execute or null if it's not set * @param feed */ public static BatchOperationType getBatchOperationType(IFeed feed) { if (feed instanceof Element) { return getBatchOperationType((Element) feed); } else { return com.google.gdata.data.batch.BatchUtils.getBatchOperationType( (ExtensionPoint) feed); } }
/** * Checks whether a batch entry is a success report. * * This method is a shortcut for checking the code of * the entry's {@link BatchStatus} object. * * @param entry * @return true if the entry is a success report. * @exception IllegalArgumentException if the entry does not contain * a BatchStatus object. */ public static boolean isSuccess(IEntry entry) { int code = getRequiredBatchStatusCode(entry); return code >= 200 && code < 300; }
/** * Checks whether a batch entry is an error report. * * This method is a shortcut for checking the code of * the entry's {@link BatchStatus} object. * * You'll want to call {@link #getStatus(IEntry)} * to get the error description and message when this * method returns true. * * @param entry * @return true if the entry is an error report. * @exception IllegalArgumentException if the entry does not contain * a BatchStatus object. */ public static boolean isFailure(IEntry entry) { return !isSuccess(entry); }