Class FieldUtils


  • public class FieldUtils
    extends java.lang.Object
    A utility class for working with Field objects.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String trimString​(java.lang.String string)
      Trims unwanted characters off of the given label, like spaces, '[',']', etc.
      static java.util.List<FieldElement> wordWrapList​(FieldElement fieldElement, int width)
      Splits the given FieldElement into sub-elements by wrapping the element on whitespace.
      static java.util.List<FieldElement> wrap​(FieldElement fieldElement, int width)
      Splits the given FieldElement into sub-elements by wrapping the element on whitespace.
      static java.util.List<FieldElement> wrap​(FieldElement fieldElement, int width, boolean breakOnWhiteSpace)
      Splits the given FieldElement into sub-elements by wrapping the element in some fashion.
      static java.util.List<FieldElement> wrap​(java.util.List<FieldElement> fieldElements, int width)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • wrap

        public static java.util.List<FieldElement> wrap​(FieldElement fieldElement,
                                                        int width)
        Splits the given FieldElement into sub-elements by wrapping the element on whitespace.
        Parameters:
        fieldElement - The element to wrap
        width - The maximum width to allow before wrapping
        Returns:
        The wrapped elements
      • wrap

        public static java.util.List<FieldElement> wrap​(FieldElement fieldElement,
                                                        int width,
                                                        boolean breakOnWhiteSpace)
        Splits the given FieldElement into sub-elements by wrapping the element in some fashion. If breakOnWhiteSpace is indicated, wrapping will break lines on a white space character if possible, otherwise wrapping occurs on the last possible character.
        Parameters:
        fieldElement - is the element to wrap
        width - is the maximum width to allow before wrapping
        breakOnWhiteSpace - determines whether line breaks should happen at white space chars
        Returns:
        the wrapped elements
      • wordWrapList

        public static java.util.List<FieldElement> wordWrapList​(FieldElement fieldElement,
                                                                int width)
        Splits the given FieldElement into sub-elements by wrapping the element on whitespace.
        Parameters:
        fieldElement - The element to wrap
        width - The maximum width to allow before wrapping
        Returns:
        The wrapped elements
      • trimString

        public static java.lang.String trimString​(java.lang.String string)
        Trims unwanted characters off of the given label, like spaces, '[',']', etc.
        Parameters:
        string - The string to be trimmed
        Returns:
        The trimmed string.