Set the ShufflingGroups.

@param \qtism\data\state\ShufflingGroupCollection $shufflingGroups
@throws \InvalidArgumentException If $shufflingGroups does not contain 1 to 2 ShufflingGroup objects.
349933
public function setShufflingGroups(ShufflingGroupCollection $shufflingGroups) 
    {
        if (count($shufflingGroups) === 0) {
            $msg = "A Shuffling object must be composed of at least 1 ShufflingGroup object. None given";
            throw new InvalidArgumentException($msg);
        } elseif (($c = count($shufflingGroups)) > 2) {
            $msg = "A Shuffling object must be composed of at most 2 ShufflingGroup objects. ${c} given.";
            throw new InvalidArgumentException($msg);
        } else {
            $this->shufflingGroups = $shufflingGroups;
        }
    }
784107
public function setMaxPlays($maxPlays)
    {
        if (is_int($maxPlays) && $maxPlays >= 0) {
            $this->maxPlays = $maxPlays;
        } else {
            $msg = "The 'maxPlays' argument must be a positive (>= 0) integer, '" . gettype($maxPlays) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1103874
public function setAll($items)
    {
        foreach ($items as $key => &$item) {
            if (is_array($item)) {
                throw new \InvalidArgumentException("Array item encountered in DistributedList::setAll() [ key = $key ].");
            } else {
                $item = (string)$item;
            }
        }

        Option::set($this->optionName, serialize($items));
    }
401924
public function setMinStrings($minStrings)
    {
        if (is_int($minStrings) && $minStrings >= 0) {
            $this->minStrings = $minStrings;
        } else {
            $msg = "The 'minStrings' argument must be a positive (>= 0) integer, '" . gettype($minStrings) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
339203
public function setSimpleChoices(SimpleChoiceCollection $simpleChoices)
    {
        if (count($simpleChoices) > 0) {
            $this->simpleChoices = $simpleChoices;
        } else {
            $msg = "An OrderInteraction object must be composed of at lease one SimpleChoice object, none given.";
            throw new InvalidArgumentException($msg);
        }
    }
795454
public function setGroups(array $groups)
    {
        foreach ($groups as $groupIdent => $groupStruct) {
            if (!is_array($groupStruct)) {
                throw new InvalidArgumentException(sprintf(
                    'The attachment group "%s" must be an array of attachable objects',
                    $groupIdent
                ));
            }

            if (isset($groupStruct['ident'])) {
                $groupIdent = $groupStruct['ident'];
                unset($groupStruct['ident']);
            }

            if (!is_string($groupIdent)) {
                throw new InvalidArgumentException(
                    'The attachment group identifier must be a string'
                );
            }

            if (isset($groupStruct['attachable_objects'])) {
                $groupStruct = $groupStruct['attachable_objects'];
            } elseif (isset($groupStruct['attachables'])) {
                $groupStruct = $groupStruct['attachables'];
            }

            $this->groups[$groupIdent] = $groupStruct;
        }

        return $this;
    }
365897
public function setCatchAll(...$parameters)
    {
        if (count($parameters) === 1) {
            $this->routes['catchAll'] = ['closure' => $parameters[0], 'groupArgs' => []];
        } elseif (count($parameters) === 2) {
            $this->routes['catchAll'] = ['closure' => $parameters[1], 'groupArgs' => $parameters[0]];
        } else {
            throw new \InvalidArgumentException;
        }
    }
1330391
public void setDBSubnetGroups(java.util.Collection<DBSubnetGroup> dBSubnetGroups) {
        if (dBSubnetGroups == null) {
            this.dBSubnetGroups = null;
            return;
        }

        this.dBSubnetGroups = new com.amazonaws.internal.SdkInternalList<DBSubnetGroup>(dBSubnetGroups);
    }
1270974
public function setMinChoices($minChoices)
    {
        if (is_int($minChoices) === true && $minChoices >= 0) {
            $this->minChoices = $minChoices;
        } else {
            $msg = "The 'minChoices' argument must be a positive integer, '" . gettype($minChoices) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1197854
public function setChildNodes(array $childNodes)
    {
        // Ensure integrity of $nodes array
        foreach ($childNodes as $childNode) {
            if (! is_a($childNode, AbstractNode::class)) {
                throw new \InvalidArgumentException(
                    'Error: Expected AbstractNode, but got "'.gettype($childNode).'"'
                );
            }
        }

        $this->childNodes = $childNodes;
    }
1142610
public function setItems($items) {

      if (!is_array($items)) {
        throw new \InvalidArgumentException('You can set only array of items');
      }

      $this->items = $items;
      $this->rewind();
      return $this;
    }
928632
public void setStaleSecurityGroupSet(java.util.Collection<StaleSecurityGroup> staleSecurityGroupSet) {
        if (staleSecurityGroupSet == null) {
            this.staleSecurityGroupSet = null;
            return;
        }

        this.staleSecurityGroupSet = new com.amazonaws.internal.SdkInternalList<StaleSecurityGroup>(staleSecurityGroupSet);
    }
665744
public function setSortConditions(array $sortConditions)
    {
        foreach ($sortConditions as $sortCondition) {
            if (! is_array($sortCondition)) {
                throw new InvalidArgumentException('Sort condition have to be an array');
            }

            if (! array_key_exists('column', $sortCondition)) {
                throw new InvalidArgumentException('Sort condition missing array key column');
            }
        }

        $this->sortConditions = $sortConditions;
    }
372637
private function setStates(array $states)
    {
        foreach ($states as $state) {
            if (!is_string($state) || strlen($state) !== 1) {
                throw new \InvalidArgumentException(
                    'State must be a one character string'
                );
            }
        }

        $this->states = $states;
    }
1353181
public void setGatewayGroups(java.util.Collection<GatewayGroupSummary> gatewayGroups) {
        if (gatewayGroups == null) {
            this.gatewayGroups = null;
            return;
        }

        this.gatewayGroups = new java.util.ArrayList<GatewayGroupSummary>(gatewayGroups);
    }
81974
public void setDBSecurityGroups(java.util.Collection<DBSecurityGroup> dBSecurityGroups) {
        if (dBSecurityGroups == null) {
            this.dBSecurityGroups = null;
            return;
        }

        this.dBSecurityGroups = new com.amazonaws.internal.SdkInternalList<DBSecurityGroup>(dBSecurityGroups);
    }
245840
public function setIds(array $ids): void
    {
        if (empty($ids)) {
            throw new \InvalidArgumentException('At least one ID must be specified');
        }

        foreach ($ids as $id) {
            if (!\is_int($id)) {
                throw new \InvalidArgumentException('All IDs must be integers');
            }
        }

        $this->ids = $ids;
    }