Check whether the batchGetRequest meet all the constraints.

@param itemsToGet
965897
private boolean validBatchGetRequest(Map<Class<?>, List<KeyPair>> itemsToGet) {
        if (itemsToGet == null || itemsToGet.size() == 0) {
            return false;
        }

        for (Class<?> clazz : itemsToGet.keySet()) {
            if (itemsToGet.get(clazz) != null && itemsToGet.get(clazz).size() > 0) {
                return true;
            }
        }
        return false;
    }
439734
@Override
    public java.util.concurrent.Future<BatchGetItemResult> batchGetItemAsync(java.util.Map<String, KeysAndAttributes> requestItems,
            String returnConsumedCapacity, com.amazonaws.handlers.AsyncHandler<BatchGetItemRequest, BatchGetItemResult> asyncHandler) {

        return batchGetItemAsync(new BatchGetItemRequest().withRequestItems(requestItems).withReturnConsumedCapacity(returnConsumedCapacity), asyncHandler);
    }
337177
private static int checkNumItems(final HttpServletRequest request,
			final ReadResponse response) {
		final String sNumItems = request
				.getParameter(ProtocolConstants.Parameters.Read.NUM_ITEMS);
		if (sNumItems != null) {
			int numItems;
			try {
				numItems = Integer.valueOf(sNumItems);
				if (numItems > 0) {
					return numItems;
				}

				response.numItemsInvalid("Please provide a number greater than zero.");
			} catch (final NumberFormatException e) {
				response.numItemsInvalid("\""
						+ sNumItems
						+ "\" is not a number. Please provide a number such as \"15\" to retrieve that number of items.");
			}
		} else {
			response.numItemsMissing();
		}

		return 0;
	}
268869
public void setPartitionsToGet(java.util.Collection<PartitionValueList> partitionsToGet) {
        if (partitionsToGet == null) {
            this.partitionsToGet = null;
            return;
        }

        this.partitionsToGet = new java.util.ArrayList<PartitionValueList>(partitionsToGet);
    }
738769
static <T> boolean iterableContains(Iterable<T> iterable, T item) {
    if (iterable instanceof Collection) {
      Collection<?> collection = (Collection<?>) iterable;
      try {
        return collection.contains(item);
      } catch (NullPointerException e) {
        return false;
      } catch (ClassCastException e) {
        return false;
      }
    }
    for (T i : iterable) {
      if (Objects.equal(i, item)) {
        return true;
      }
    }
    return false;
  }
980237
public T match(Collection<I> items)
    {
        for (I item : items)
        {
            T match = match(item);
            if (match != null)
            {
                return match;
            }
        }
        return null;
    }
1169505
private void validateMandatoryItem(ItemState changedItem) throws ConstraintViolationException, AccessDeniedException
   {
      if (changedItem.getData().isNode() && (changedItem.isAdded() || changedItem.isMixinChanged())
         && !changesLog.getItemState(changedItem.getData().getQPath()).isDeleted())
      {
         // Node not in delete state. It might be a wrong
         if (!changesLog.getItemState(changedItem.getData().getIdentifier()).isDeleted())
         {
            NodeData nData = (NodeData)changedItem.getData();
            try
            {
               validateMandatoryChildren(nData);
            }
            catch (ConstraintViolationException e)
            {
               throw e;
            }
            catch (AccessDeniedException e)
            {
               throw e;
            }
            catch (RepositoryException e)
            {
               LOG.warn("Unexpected exception. Probable wrong data. Exception message:" + e.getLocalizedMessage());
            }
         }
      }
   }
529405
protected function checkConstraints(
        Item $itemToPack
    ): bool {
        return $this->checkNonDimensionalConstraints($itemToPack) &&
               $this->checkDimensionalConstraints($itemToPack);
    }
429333
public void setItems(java.util.Collection<ApiMapping> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<ApiMapping>(items);
    }
1144163
public void setItems(java.util.Collection<Resource> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<Resource>(items);
    }
991361
public static BaasResult<List<BaasDocument>> fetchAllSync(String collection, BaasQuery.Criteria filter) {
        BaasBox box = BaasBox.getDefaultChecked();
        if (collection == null) throw new IllegalArgumentException("collection cannot be null");
        Fetch f = new Fetch(box, collection, filter, RequestOptions.DEFAULT, null);
        return box.submitSync(f);
    }
141844
public static <T> T max(Iterable<T> items) {
        T answer = null;
        for (T value : items) {
            if (value != null) {
                if (answer == null || ScriptBytecodeAdapter.compareGreaterThan(value, answer)) {
                    answer = value;
                }
            }
        }
        return answer;
    }
934496
public static final <T> boolean containsOnly(short[] array, T... items)
    {
        for (short b : array)
        {
            if (!contains(items, b))
            {
                return false;
            }
        }
        return true;
    }
788405
def _batch_write_item(self, items):
        
        kwargs = {
            'RequestItems': {
                self.tablename: items,
            },
            'ReturnConsumedCapacity': self.return_capacity,
            'ReturnItemCollectionMetrics': self.return_item_collection_metrics,
        }
        return self.connection.call('batch_write_item', **kwargs)
1332120
public function get($itemsToGet = 0, $offset = 0)
    {
        $pages = [];
        if ($this->getQuery() == '') {
            $this->setBaseQuery();
        }

        $this->setItemsPerPage($itemsToGet);

        $r = parent::get($itemsToGet, $offset);
        foreach ($r as $row) {
            $nc = $this->loadPageID($row['cID'], 'ACTIVE');
            if (!$this->displayOnlyApprovedPages) {
                $cp = new Permissions($nc);
                if ($cp->canViewPageVersions()) {
                    $nc->loadVersionObject('RECENT');
                }
            }
            $nc->setPageIndexScore($row['cIndexScore']);
            $pages[] = $nc;
        }

        return $pages;
    }
101717
public static boolean isConstraintSatisfied(Project project,
            Set<Class<ProjectFacet>> requiredFacets)
   {
      boolean constraintsSatisfied = true;
      Iterable<StackFacet> stackFacets = project.getFacets(StackFacet.class);
      OUTER: for (StackFacet stackFacet : stackFacets)
      {
         for (Class<ProjectFacet> type : requiredFacets)
         {
            if (!stackFacet.getStack().supports(type))
            {
               constraintsSatisfied = false;
               break OUTER;
            }
         }
      }
      return constraintsSatisfied;
   }
266061
private void checkCollectionForeignkeys(ModelDef modelDef, String checkLevel) throws ConstraintException
    {
        if (CHECKLEVEL_NONE.equals(checkLevel))
        {
            return;
        }

        ClassDescriptorDef      classDef;
        CollectionDescriptorDef collDef;

        for (Iterator it = modelDef.getClasses(); it.hasNext();)
        {
            classDef = (ClassDescriptorDef)it.next();
            for (Iterator collIt = classDef.getCollections(); collIt.hasNext();)
            {
                collDef = (CollectionDescriptorDef)collIt.next();
                if (!collDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_IGNORE, false))
                {
                    if (collDef.hasProperty(PropertyHelper.OJB_PROPERTY_INDIRECTION_TABLE))
                    {
                        checkIndirectionTable(modelDef, collDef);
                    }
                    else
                    {    
                        checkCollectionForeignkeys(modelDef, collDef);
                    }
                }
            }
        }
    }