org.crsh.util
Class Utils
java.lang.Object
org.crsh.util.Utils
public class Utils
- extends Object
Constructor Summary |
Utils()
|
Method Summary |
static String |
globexToRegex(String globex)
Create a pattern that transforms a glob expression into a regular expression, the following task are supported
* : Match any number of unknown characters
? : Match one unknown character
[characters] : Match a character as part of a group of characters
\ : Escape character
|
static int |
indexOf(CharSequence s,
int off,
char c)
|
static
|
list(E... elements)
|
static
|
list(Iterable<E> iterable)
|
static
|
list(Iterator<E> iterator)
|
static
|
map(K key,
V value)
|
static
<K,V,M extends Map<K,V>>
M |
|
map(M map,
K key,
V value)
|
static
|
newArrayList()
|
static
|
newHashMap()
|
static
|
newHashSet()
|
static
|
newLinkedList()
|
static
|
notNull(E e1,
E e2)
|
static String |
trimLeft(String s)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FOO
private static final Pattern FOO
Utils
public Utils()
newArrayList
public static <E> ArrayList<E> newArrayList()
newLinkedList
public static <E> LinkedList<E> newLinkedList()
newHashSet
public static <E> HashSet<E> newHashSet()
newHashMap
public static <K,V> HashMap<K,V> newHashMap()
map
public static <K,V,M extends Map<K,V>> M map(M map,
K key,
V value)
map
public static <K,V> HashMap<K,V> map(K key,
V value)
list
public static <E> List<E> list(E... elements)
list
public static <E> List<E> list(Iterable<E> iterable)
list
public static <E> List<E> list(Iterator<E> iterator)
indexOf
public static int indexOf(CharSequence s,
int off,
char c)
trimLeft
public static String trimLeft(String s)
notNull
public static <E> E notNull(E e1,
E e2)
globexToRegex
public static String globexToRegex(String globex)
throws NullPointerException
- Create a pattern that transforms a glob expression into a regular expression, the following task are supported
- * : Match any number of unknown characters
- ? : Match one unknown character
- [characters] : Match a character as part of a group of characters
- \ : Escape character
- Parameters:
globex
- the glob expression
- Returns:
- the regular expression
- Throws:
NullPointerException
- when the globex argument is null
Copyright © 2014 eXo Platform SAS. All Rights Reserved.