@Override /* Object */ public String toString() { return StringUtils.join(typeRanges, ','); } }
/** * Joins tokens with newlines. * * @param tokens The tokens to concatenate. * @return A string with the specified tokens contatenated with newlines. */ public static String joinnl(Object[] tokens) { return join(tokens, '\n'); }
@Override /* Object */ public String toString() { return join(parts, '.'); } }
@Override /* Object */ public String toString() { return StringUtils.join(typeRanges, ','); } }
@Override /* Object */ public String toString() { return StringUtils.join(typeRanges, ','); } }
@Override /* Object */ public String toString() { return StringUtils.join(value, ", "); } }
@Override /* Object */ public String toString() { return join(mediaRanges, ','); } }
/** * Joins tokens with newlines. * * @param tokens The tokens to concatenate. * @return A string with the specified tokens contatenated with newlines. */ public static String joinnl(Object[] tokens) { return join(tokens, '\n'); }
@Override /* Object */ public String toString() { return join(parts, '.'); } }
/** * Joins the specified tokens into a delimited string. * * @param tokens The tokens to join. * @param d The delimiter. * @return The delimited string. If <code>tokens</code> is <jk>null</jk>, returns <jk>null</jk>. */ public static String join(Object[] tokens, char d) { if (tokens == null) return null; return join(tokens, d, new StringBuilder()).toString(); }
/** * Join the specified tokens into a delimited string. * * @param tokens The tokens to join. * @param d The delimiter. * @return The delimited string. If <code>tokens</code> is <jk>null</jk>, returns <jk>null</jk>. */ public static String join(Collection<?> tokens, String d) { if (tokens == null) return null; return join(tokens, d, new StringBuilder()).toString(); }
/** * Joins the specified tokens into a delimited string. * * @param tokens The tokens to join. * @param d The delimiter. * @return The delimited string. If <code>tokens</code> is <jk>null</jk>, returns <jk>null</jk>. */ public static String join(Object[] tokens, char d) { if (tokens == null) return null; return join(tokens, d, new StringBuilder()).toString(); }
/** * Join the specified tokens into a delimited string. * * @param tokens The tokens to join. * @param d The delimiter. * @return The delimited string. If <code>tokens</code> is <jk>null</jk>, returns <jk>null</jk>. */ public static String join(Collection<?> tokens, String d) { if (tokens == null) return null; return join(tokens, d, new StringBuilder()).toString(); }
static String resolveNewlineSeparatedAnnotation(String[] value, String fromParent) { if (value.length == 0) return fromParent; List<String> l = new ArrayList<>(); for (String v : value) { if (! "INHERIT".equals(v)) l.add(v); else if (fromParent != null) l.addAll(Arrays.asList(fromParent)); } return join(l, '\n'); }
@Override /* Object */ public String toString() { List<String> l = new ArrayList<>(); if (line != -1) l.add("line " + line); if (column != -1) l.add("column " + column); if (position != -1) l.add("position " + position); if (l.isEmpty()) l.add("unknown"); return StringUtils.join(l, ", "); }
@Override /* MultipartVar */ public String resolve(VarResolverSession session, String[] args) { return join(args, '+'); } }
/** * Convenience method for specifying the manifest contents directly. * * @param contents The lines in the manifest file. * @return This object (for method chaining). * @throws IOException */ public Microservice setManifestContents(String...contents) throws IOException { String s = StringUtils.join(contents, "\n") + "\n"; return setManifest(new ManifestFile(new Manifest(new ByteArrayInputStream(s.getBytes("UTF-8"))))); }
/** * Throws a {@link BeanRuntimeException} if any warnings occurred in this session. */ public void checkForWarnings() { if (warnings != null && ! warnings.isEmpty()) throw new BeanRuntimeException("Warnings occurred in session: \n" + join(getWarnings(), "\n")); } }
/** * Throws a {@link BeanRuntimeException} if any warnings occurred in this session. */ public void checkForWarnings() { if (warnings != null && ! warnings.isEmpty()) throw new BeanRuntimeException("Warnings occurred in session: \n" + join(getWarnings(), "\n")); } }
@Test public void testSplitEqually() { assertNull(null, splitEqually(null, 3)); assertEquals("", join(splitEqually("", 3), '|')); assertEquals("a", join(splitEqually("a", 3), '|')); assertEquals("ab", join(splitEqually("ab", 3), '|')); assertEquals("abc", join(splitEqually("abc", 3), '|')); assertEquals("abc|d", join(splitEqually("abcd", 3), '|')); }