org.apache.hadoop.yarn.util
Class StringHelper

java.lang.Object
  extended by org.apache.hadoop.yarn.util.StringHelper

public final class StringHelper
extends Object

Common string manipulation helpers


Field Summary
static com.google.common.base.Joiner _JOINER
           
static com.google.common.base.Splitter _SPLITTER
           
static com.google.common.base.Joiner CSV_JOINER
           
static com.google.common.base.Joiner DOT_JOINER
           
static com.google.common.base.Joiner JOINER
           
static com.google.common.base.Joiner PATH_ARG_JOINER
           
static com.google.common.base.Joiner PATH_JOINER
           
static com.google.common.base.Joiner SSV_JOINER
           
static com.google.common.base.Splitter SSV_SPLITTER
           
 
Constructor Summary
StringHelper()
           
 
Method Summary
static String _join(Object... args)
          Join on underscore
static Iterable<String> _split(CharSequence s)
          Split on _ & trim results
static String cjoin(Object... args)
          Join on comma.
static String djoin(Object... args)
          Join on dot
static boolean isAbsUrl(CharSequence url)
          Check whether a url is absolute or note
static String join(Object... args)
          Join without separator
static String joins(String sep, Object... args)
          Join with a separator
static String pajoin(Object... args)
          Join on slash & colon (e.g., path args in routing spec)
static String percent(double value)
           
static String pjoin(Object... args)
          Join on slash
static String sjoin(Object... args)
          Join on space.
static Iterable<String> split(CharSequence s)
          Split on space & trim results.
static String ujoin(String pathPrefix, String... args)
          Join url components
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SSV_JOINER

public static final com.google.common.base.Joiner SSV_JOINER

CSV_JOINER

public static final com.google.common.base.Joiner CSV_JOINER

JOINER

public static final com.google.common.base.Joiner JOINER

_JOINER

public static final com.google.common.base.Joiner _JOINER

PATH_JOINER

public static final com.google.common.base.Joiner PATH_JOINER

PATH_ARG_JOINER

public static final com.google.common.base.Joiner PATH_ARG_JOINER

DOT_JOINER

public static final com.google.common.base.Joiner DOT_JOINER

SSV_SPLITTER

public static final com.google.common.base.Splitter SSV_SPLITTER

_SPLITTER

public static final com.google.common.base.Splitter _SPLITTER
Constructor Detail

StringHelper

public StringHelper()
Method Detail

sjoin

public static String sjoin(Object... args)
Join on space.

Parameters:
args - to join
Returns:
args joined by space

cjoin

public static String cjoin(Object... args)
Join on comma.

Parameters:
args - to join
Returns:
args joined by comma

djoin

public static String djoin(Object... args)
Join on dot

Parameters:
args - to join
Returns:
args joined by dot

_join

public static String _join(Object... args)
Join on underscore

Parameters:
args - to join
Returns:
args joined underscore

pjoin

public static String pjoin(Object... args)
Join on slash

Parameters:
args - to join
Returns:
args joined with slash

pajoin

public static String pajoin(Object... args)
Join on slash & colon (e.g., path args in routing spec)

Parameters:
args - to join
Returns:
args joined with /:

join

public static String join(Object... args)
Join without separator

Parameters:
args -
Returns:
joined args with no separator

joins

public static String joins(String sep,
                           Object... args)
Join with a separator

Parameters:
sep - the separator
args - to join
Returns:
args joined with a separator

split

public static Iterable<String> split(CharSequence s)
Split on space & trim results.

Parameters:
s - the string to split
Returns:
an iterable of strings

_split

public static Iterable<String> _split(CharSequence s)
Split on _ & trim results

Parameters:
s - the string to split
Returns:
an iterable of strings

isAbsUrl

public static boolean isAbsUrl(CharSequence url)
Check whether a url is absolute or note

Parameters:
url - to check
Returns:
true if url starts with scheme:// or //

ujoin

public static String ujoin(String pathPrefix,
                           String... args)
Join url components

Parameters:
pathPrefix - for relative urls
args - url components to join
Returns:
an url string

percent

public static String percent(double value)


Copyright © 2012 Apache Software Foundation. All Rights Reserved.