com.versionone.apiclient.services

## Class TextBuilder

- java.lang.Object
- - com.versionone.apiclient.services.TextBuilder

-     public class TextBuilder
      extends Object

  Static methods for text manipulation.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TextBuilder.DefaultStringize` Default Delegate used by TextBuilder.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Delegator` | `STRINGIZER_DELEGATE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextBuilder()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `join(List pathParts, String seperator)` Join with a list using "toString" method of each object in the list
    `static String` | `join(List pathParts, String seperator, IDelegate stringize)` Join with a list using specific method to join
    `static String` | `join(Object[] pathParts, String seperator)` Join an array of objects using their "toString" method.
    `static String` | `join(Object[] pathParts, String seperator, IDelegate stringize)` Join an array of objects using a specific method common to all objects
    `static void` | `splitPrefix(String source, char separator, StringBuffer prefix, StringBuffer suffix)` Split a string at the first occurrence of a character.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### STRINGIZER_DELEGATE

          public static final Delegator STRINGIZER_DELEGATE

  - ### Constructor Detail

    - #### TextBuilder

          public TextBuilder()

  - ### Method Detail

    - #### splitPrefix

          public static void splitPrefix(String source,
                                         char separator,
                                         StringBuffer prefix,
                                         StringBuffer suffix)

      Split a string at the first occurrence of a character. for example: foo:bar split at : would return foo as the prefix and bar as the suffix. The : is not returned. Used mainly for parsing tokens
      Parameters:
        `source` - - string to split
        `separator` - - character for split
        `prefix` - - string before the separator
        `suffix` - - string after the separator

    - #### join

          public static String join(Object[] pathParts,
                                    String seperator)

      Join an array of objects using their "toString" method. Each object is separated by the separator character Example: `String[] input = {"the", "join", "example"}; String result = TextBuilder.join(input, ":");` Result is "the:join:example"
      Parameters:
        `pathParts` - - objects to join
        `seperator` - - character used to separate objects
      Returns:
        String

    - #### join

          public static String join(Object[] pathParts,
                                    String seperator,
                                    IDelegate stringize)

      Join an array of objects using a specific method common to all objects
      Parameters:
        `pathParts` - - objects to join
        `seperator` - - character to separate object
        `stringize` - - Method on objects to obtain string. All objects in list must declare this method as public.
      Returns:
        String

    - #### join

          public static String join(List pathParts,
                                    String seperator)

      Join with a list using "toString" method of each object in the list
      Parameters:
        `pathParts` - - list of objects to join
        `seperator` - - character used to separate each object
      Returns:
        String
      See Also:
        `join(Object[], String)`

    - #### join

          public static String join(List pathParts,
                                    String seperator,
                                    IDelegate stringize)

      Join with a list using specific method to join
      Parameters:
        `pathParts` - - List of objects to join
        `seperator` - - character used to separate each object
        `stringize` - - method on object. All objects in list must declare this method as public.
      Returns:
        String
      See Also:
        `join(Object[], String, IDelegate)`

Copyright © 2016 VersionOne, Inc.. All rights reserved.