@Test public void testFixedLengthWithIntValue() { final boolean[] left = {true, true, false, false, false}; final char[] filler = {' ', ' ', ' ', '0', ' '}; final int[] s = {89, 1234, 89, 89, 1234}; final String[][] expected = { {"", "", "", "", ""}, {"8", "1", "9", "9", "4"}, {"89", "12", "89", "89", "34"}, {"89 ", "123", " 89", "089", "234"}, {"89 ", "1234", " 89", "0089", "1234"} }; for (int i = 0; i < expected.length; i++) { for (int j = 0; j < expected.length; j++) { final String actual = StringUtil.fixSizeString(j, left[i], filler[i], s[i]); Assert.assertEquals("length=" + j + " of " + s[i], expected[j][i], actual); } } }
public static String fixSizeString(int size, boolean alignLeft, char filler, long value) { return fixSizeString(size, alignLeft, filler, String.valueOf(value)); }
StringUtil { public static String fixSizeString(int size, boolean alignLeft, char filler, long value) { return fixSizeString(size, alignLeft, filler, String.valueOf(value)); } }
StringUtil { public static String fixSizeString(int size, boolean alignLeft, char filler, long value) { return fixSizeString(size, alignLeft, filler, String.valueOf(value)); } private  StringUtil(); }
StringUtil { public static String fixSizeString(int size, boolean alignLeft, char filler, long value) { return fixSizeString(size, alignLeft, filler, String.valueOf(value)); } private  StringUtil(); static String fixSizeString(int size, boolean alignLeft,
			char filler, long value); static String fixSizeString(int size, boolean alignLeft,
			String s); static String fixSizeString(int size, boolean alignLeft,
			char filler, String s); static List<Line> splitLines(String s); static int findStartTrimWhitespace(CharSequence s); static int findStartTrimWhitespace(CharSequence s, int start); static int findEndTrimWhitespace(CharSequence s); static int findStartTrimNewlineChars(CharSequence s); static int findStartTrimNewlineChars(CharSequence s, int start); static int findEndTrimNewlineChars(CharSequence s); static int findWhitespace(CharSequence s); static int findWhitespace(CharSequence s, int start); static boolean containsIgnoreCase(String source, String target); static boolean startsWithIgnoreCase(String s, String prefix); static int indexOfIgnoreCase(String source, String target); static boolean equalsIgnoreCase(char ch1, char ch2); }
StringUtil { public static String fixSizeString(int size, boolean alignLeft, char filler, long value) { return fixSizeString(size, alignLeft, filler, String.valueOf(value)); } private  StringUtil(); static String fixSizeString(int size, boolean alignLeft,
			char filler, long value); static String fixSizeString(int size, boolean alignLeft,
			String s); static String fixSizeString(int size, boolean alignLeft,
			char filler, String s); static List<Line> splitLines(String s); static int findStartTrimWhitespace(CharSequence s); static int findStartTrimWhitespace(CharSequence s, int start); static int findEndTrimWhitespace(CharSequence s); static int findStartTrimNewlineChars(CharSequence s); static int findStartTrimNewlineChars(CharSequence s, int start); static int findEndTrimNewlineChars(CharSequence s); static int findWhitespace(CharSequence s); static int findWhitespace(CharSequence s, int start); static boolean containsIgnoreCase(String source, String target); static boolean startsWithIgnoreCase(String s, String prefix); static int indexOfIgnoreCase(String source, String target); static boolean equalsIgnoreCase(char ch1, char ch2);  }