<p>
An array of patches. Each entry in the array is a patch structure.
</p>

@param patches
An array of patches. Each entry in the array is a patch structure.
193256
public void setPatches(java.util.Collection<Patch> patches) {
        if (patches == null) {
            this.patches = null;
            return;
        }

        this.patches = new com.amazonaws.internal.SdkInternalList<Patch>(patches);
    }
408052
public String patch_addPadding(LinkedList<Patch> patches) {
        short paddingLength = Patch_Margin;
        String nullPadding = "";
        for (short x = 1; x <= paddingLength; x++) {
            nullPadding += String.valueOf((char) x);
        }

        // Bump all the patches forward.
        for (Patch aPatch : patches) {
            aPatch.start1 += paddingLength;
            aPatch.start2 += paddingLength;
        }

        // Add some padding on start of first diff.
        Patch patch = patches.getFirst();
        LinkedList<Diff> diffs = patch.diffs;
        if (diffs.isEmpty() || diffs.getFirst().operation != Operation.EQUAL) {
            // Add nullPadding equality.
            diffs.addFirst(new Diff(Operation.EQUAL, nullPadding));
            patch.start1 -= paddingLength; // Should be 0.
            patch.start2 -= paddingLength; // Should be 0.
            patch.length1 += paddingLength;
            patch.length2 += paddingLength;
        } else if (paddingLength > diffs.getFirst().text.length()) {
            // Grow first equality.
            Diff firstDiff = diffs.getFirst();
            int extraLength = paddingLength - firstDiff.text.length();
            firstDiff.text = nullPadding.substring(firstDiff.text.length())
                    + firstDiff.text;
            patch.start1 -= extraLength;
            patch.start2 -= extraLength;
            patch.length1 += extraLength;
            patch.length2 += extraLength;
        }

        // Add some padding on end of last diff.
        patch = patches.getLast();
        diffs = patch.diffs;
        if (diffs.isEmpty() || diffs.getLast().operation != Operation.EQUAL) {
            // Add nullPadding equality.
            diffs.addLast(new Diff(Operation.EQUAL, nullPadding));
            patch.length1 += paddingLength;
            patch.length2 += paddingLength;
        } else if (paddingLength > diffs.getLast().text.length()) {
            // Grow last equality.
            Diff lastDiff = diffs.getLast();
            int extraLength = paddingLength - lastDiff.text.length();
            lastDiff.text += nullPadding.substring(0, extraLength);
            patch.length1 += extraLength;
            patch.length2 += extraLength;
        }

        return nullPadding;
    }
644667
@Override
    public void setBonds(IBond[] bonds) {
        this.bonds = bonds;
        for (IBond bond : bonds) {
            bond.addListener(this);
        }
        this.bondCount = bonds.length;
    }
200426
public final void addEntries(Iterator<Entry<?>> entries) {
        if (entries != null) {
            while (entries.hasNext()) {
                addEntry(entries.next());
            }
        }
    }
616418
public void patch_splitMax(LinkedList<Patch> patches) {
        short patch_size = Match_MaxBits;
        String precontext, postcontext;
        Patch patch;
        int start1, start2;
        boolean empty;
        Operation diff_type;
        String diff_text;
        ListIterator<Patch> pointer = patches.listIterator();
        Patch bigpatch = pointer.hasNext() ? pointer.next() : null;
        while (bigpatch != null) {
            if (bigpatch.length1 <= Match_MaxBits) {
                bigpatch = pointer.hasNext() ? pointer.next() : null;
                continue;
            }
            // Remove the big old patch.
            pointer.remove();
            start1 = bigpatch.start1;
            start2 = bigpatch.start2;
            precontext = "";
            while (!bigpatch.diffs.isEmpty()) {
                // Create one of several smaller patches.
                patch = new Patch();
                empty = true;
                patch.start1 = start1 - precontext.length();
                patch.start2 = start2 - precontext.length();
                if (precontext.length() != 0) {
                    patch.length1 = patch.length2 = precontext.length();
                    patch.diffs.add(new Diff(Operation.EQUAL, precontext));
                }
                while (!bigpatch.diffs.isEmpty()
                        && patch.length1 < patch_size - Patch_Margin) {
                    diff_type = bigpatch.diffs.getFirst().operation;
                    diff_text = bigpatch.diffs.getFirst().text;
                    if (diff_type == Operation.INSERT) {
                        // Insertions are harmless.
                        patch.length2 += diff_text.length();
                        start2 += diff_text.length();
                        patch.diffs.addLast(bigpatch.diffs.removeFirst());
                        empty = false;
                    } else if (diff_type == Operation.DELETE
                            && patch.diffs.size() == 1
                            && patch.diffs.getFirst().operation == Operation.EQUAL
                            && diff_text.length() > 2 * patch_size) {
                        // This is a large deletion. Let it pass in one chunk.
                        patch.length1 += diff_text.length();
                        start1 += diff_text.length();
                        empty = false;
                        patch.diffs.add(new Diff(diff_type, diff_text));
                        bigpatch.diffs.removeFirst();
                    } else {
                        // Deletion or equality. Only take as much as we can
                        // stomach.
                        diff_text = diff_text.substring(
                                0,
                                Math.min(diff_text.length(), patch_size
                                        - patch.length1 - Patch_Margin));
                        patch.length1 += diff_text.length();
                        start1 += diff_text.length();
                        if (diff_type == Operation.EQUAL) {
                            patch.length2 += diff_text.length();
                            start2 += diff_text.length();
                        } else {
                            empty = false;
                        }
                        patch.diffs.add(new Diff(diff_type, diff_text));
                        if (diff_text.equals(bigpatch.diffs.getFirst().text)) {
                            bigpatch.diffs.removeFirst();
                        } else {
                            bigpatch.diffs.getFirst().text = bigpatch.diffs
                                    .getFirst().text.substring(diff_text
                                    .length());
                        }
                    }
                }
                // Compute the head context for the next patch.
                precontext = diff_text2(patch.diffs);
                precontext = precontext.substring(Math.max(0,
                        precontext.length() - Patch_Margin));
                // Append the end context for this patch.
                if (diff_text1(bigpatch.diffs).length() > Patch_Margin) {
                    postcontext = diff_text1(bigpatch.diffs).substring(0,
                            Patch_Margin);
                } else {
                    postcontext = diff_text1(bigpatch.diffs);
                }
                if (postcontext.length() != 0) {
                    patch.length1 += postcontext.length();
                    patch.length2 += postcontext.length();
                    if (!patch.diffs.isEmpty()
                            && patch.diffs.getLast().operation == Operation.EQUAL) {
                        patch.diffs.getLast().text += postcontext;
                    } else {
                        patch.diffs.add(new Diff(Operation.EQUAL, postcontext));
                    }
                }
                if (!empty) {
                    pointer.add(patch);
                }
            }
            bigpatch = pointer.hasNext() ? pointer.next() : null;
        }
    }
472895
public void setEntries(Map<String, String> entries) {

        String[][] entriesArray = null;
        if ((entries != null) && !entries.isEmpty()) {
            entriesArray = new String[entries.size()][];
            int i = 0;
            for (Entry<String, String> entry : entries.entrySet()) {
                entriesArray[i] = new String[] {entry.getKey(), entry.getValue()};
                i++;
            }
        }

        getState().setEntries(entriesArray);
    }
530895
public static boolean stringInPatterns(String s, List<Pattern> patterns) {
    for (Pattern pattern : patterns) {
      if (pattern.matcher(s).matches()) {
        return true;
      }
    }
    return false;
  }
348551
protected Patch createProcessedPatch(final Patch original) {

        // Process elements
        final List<PatchElement> elements = new ArrayList<PatchElement>();
        // Process layers
        for (final PatchEntry entry : getLayers()) {
            final PatchElement element = createPatchElement(entry, entry.element.getId(), entry.modifications);
            elements.add(element);
        }
        // Process add-ons
        for (final PatchEntry entry : getAddOns()) {
            final PatchElement element = createPatchElement(entry, entry.element.getId(), entry.modifications);
            elements.add(element);
        }

        // Swap the patch element modifications, keep the identity ones since we don't need to fix the misc modifications
        return new PatchImpl(original.getPatchId(), original.getDescription(), original.getLink(), original.getIdentity(), elements, identityEntry.modifications);
    }
221380
public Router patch(@NotNull final Pattern regex, @NotNull final IMiddleware... handlers) {
        addRegEx("PATCH", regex, handlers, patchBindings);
        return this;
    }
215844
public void applyPatterns(String[] patterns)
   {
      m_formats = new SimpleDateFormat[patterns.length];
      for (int index = 0; index < patterns.length; index++)
      {
         m_formats[index] = new SimpleDateFormat(patterns[index]);
      }
   }
1095553
public void setSamlProviderARNs(java.util.Collection<String> samlProviderARNs) {
        if (samlProviderARNs == null) {
            this.samlProviderARNs = null;
            return;
        }

        this.samlProviderARNs = new java.util.ArrayList<String>(samlProviderARNs);
    }
403354
public void addPattern(Pattern pattern) {
        if (patterns == null) {
            patterns = new ArrayList<Pattern>();
        }

        patterns.add(pattern);
    }
923889
def patch_nodes(self, patches):
        
        # because we don't have any mapping from node _names_ to nodes, and we
        # only have the node name in the patch, we have to iterate over all the
        # nodes looking for matching names. We could use _find_by_name if we
        # were ok with doing an O(n*m) search (one nodes scan per patch)
        for node in self.nodes.values():
            if node.resource_type != NodeType.Model:
                continue
            patch = patches.pop(node.name, None)
            if not patch:
                continue
            node.patch(patch)

        # log debug-level warning about nodes we couldn't find
        if patches:
            for patch in patches.values():
                # since patches aren't nodes, we can't use the existing
                # target_not_found warning
                logger.debug((
                    'WARNING: Found documentation for model "{}" which was '
                    'not found or is disabled').format(patch.name)
                )
299361
public void setAddresses(java.util.Collection<Address> addresses) {
        if (addresses == null) {
            this.addresses = null;
            return;
        }

        this.addresses = new com.amazonaws.internal.SdkInternalList<Address>(addresses);
    }
1078464
public void setProjects(java.util.Collection<String> projects) {
        if (projects == null) {
            this.projects = null;
            return;
        }

        this.projects = new java.util.ArrayList<String>(projects);
    }
249916
public void setRegexMatchSets(java.util.Collection<RegexMatchSetSummary> regexMatchSets) {
        if (regexMatchSets == null) {
            this.regexMatchSets = null;
            return;
        }

        this.regexMatchSets = new java.util.ArrayList<RegexMatchSetSummary>(regexMatchSets);
    }
482880
private void loadPatches() throws IOException {
    List<Path> paths = Utils.listResources(PATCHES);
    for (Path path : paths) {
      String fileName = path.getFileName().toString();
      if (fileName.endsWith(".json")) {
        JsonObject root = load(path);
        patches.put(fileName, root);
      }
    }
  }