Class ResultUtils

java.lang.Object
com.unboundid.ldap.sdk.unboundidds.tools.ResultUtils

This class provides a set of utility methods for formatting operation results.
NOTE: This class, and other classes within the com.unboundid.ldap.sdk.unboundidds package structure, are only supported for use against Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 server products. These classes provide support for proprietary functionality or for external specifications that are not considered stable or mature enough to be guaranteed to work in an interoperable way with other types of LDAP servers.
  • Method Details

    • formatResult

      @NotNull public static List<String> formatResult(@NotNull LDAPResult result, boolean comment, int indent, int maxWidth)
      Retrieves a list of strings that comprise a formatted representation of the provided result.
      Parameters:
      result - The result to be formatted.
      comment - Indicates whether to prefix each line with an octothorpe to indicate that it is a comment.
      indent - The number of spaces to indent each line.
      maxWidth - The maximum length of each line in characters, including the comment prefix and indent.
      Returns:
      A list of strings that comprise a formatted representation of the provided result.
    • formatResult

      @NotNull public static List<String> formatResult(@NotNull LDAPException ldapException, boolean comment, int indent, int maxWidth)
      Retrieves a list of strings that comprise a formatted representation of the result encapsulated by the provided exception.
      Parameters:
      ldapException - The exception to use to obtain the result to format.
      comment - Indicates whether to prefix each line with an octothorpe to indicate that it is a comment.
      indent - The number of spaces to indent each line.
      maxWidth - The maximum length of each line in characters, including the comment prefix and indent.
      Returns:
      A list of strings that comprise a formatted representation of the result encapsulated by the provided exception.
    • formatResult

      public static void formatResult(@NotNull List<String> lines, @NotNull LDAPResult result, boolean comment, boolean inTxn, int indent, int maxWidth)
      Adds a multi-line string representation of the provided result to the given list.
      Parameters:
      lines - The list to which the lines should be added.
      result - The result to be formatted.
      comment - Indicates whether to prefix each line with an octothorpe to indicate that it is a comment.
      inTxn - Indicates whether the operation is part of an active transaction.
      indent - The number of spaces to indent each line.
      maxWidth - The maximum length of each line in characters, including the comment prefix and indent.
    • formatSearchResultEntry

      public static void formatSearchResultEntry(@NotNull List<String> lines, @NotNull SearchResultEntry entry, int maxWidth)
      Updates the provided list with an LDIF representation of the provided search result entry to the given list, preceded by comments about any controls that may be included with the entry.
      Parameters:
      lines - The list to which the formatted representation will be added.
      entry - The entry to be formatted.
      maxWidth - The maximum length of each line in characters, including any comment prefix and indent.
    • formatSearchResultReference

      public static void formatSearchResultReference(@NotNull List<String> lines, @NotNull SearchResultReference reference, int maxWidth)
      Updates the provided with with a string representation of the provided search result reference. The information will be written as LDIF comments, and will include any referral URLs contained in the reference, as well as information about any associated controls.
      Parameters:
      lines - The list to which the formatted representation will be added.
      reference - The search result reference to be formatted.
      maxWidth - The maximum length of each line in characters, including any comment prefix and indent.
    • formatUnsolicitedNotification

      public static void formatUnsolicitedNotification(@NotNull List<String> lines, @NotNull ExtendedResult notification, boolean comment, int indent, int maxWidth)
      Adds a multi-line string representation of the provided unsolicited notification to the given list.
      Parameters:
      lines - The list to which the lines should be added.
      notification - The unsolicited notification to be formatted.
      comment - Indicates whether to prefix each line with an octothorpe to indicate that it is a comment.
      indent - The number of spaces to indent each line.
      maxWidth - The maximum length of each line in characters, including the comment prefix and indent.
    • formatResponseControl

      public static void formatResponseControl(@NotNull List<String> lines, @NotNull Control c, boolean comment, int indent, int maxWidth)
      Adds a multi-line string representation of the provided result to the given list.
      Parameters:
      lines - The list to which the lines should be added.
      c - The control to be formatted.
      comment - Indicates whether to prefix each line with an octothorpe to indicate that it is a comment.
      indent - The number of spaces to indent each line.
      maxWidth - The maximum length of each line in characters, including the comment prefix and indent.