com.pmease.quickbuild.execution.killtree
Class Util

java.lang.Object
  extended by com.pmease.quickbuild.execution.killtree.Util

public class Util
extends java.lang.Object

Various utility methods that don't have more proper home.


Constructor Summary
Util()
           
 
Method Summary
static java.lang.String fixEmpty(java.lang.String s)
          Convert empty string to null.
static java.lang.String fixEmptyAndTrim(java.lang.String s)
          Convert empty string to null, and trim whitespace.
static
<T> java.util.Collection<T>
fixNull(java.util.Collection<T> l)
           
static
<T> java.lang.Iterable<T>
fixNull(java.lang.Iterable<T> l)
           
static
<T> java.util.List<T>
fixNull(java.util.List<T> l)
           
static
<T> java.util.Set<T>
fixNull(java.util.Set<T> l)
           
static java.lang.String fixNull(java.lang.String s)
          Convert null to "".
static java.lang.String join(java.util.Collection<?> strings, java.lang.String separator)
          Concatenate multiple strings by inserting a separator.
static
<T> java.util.List<T>
join(java.util.Collection<? extends T>... items)
          Combines all the given collections into a single list.
static java.lang.String replaceMacro(java.lang.String s, java.util.Map<java.lang.String,java.lang.String> properties)
          Replaces the occurrence of '$key' by properties.get('key').
static java.lang.String replaceMacro(java.lang.String s, VariableResolver<java.lang.String> resolver)
          Replaces the occurrence of '$key' by resolver.get('key').
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

replaceMacro

public static java.lang.String replaceMacro(java.lang.String s,
                                            java.util.Map<java.lang.String,java.lang.String> properties)
Replaces the occurrence of '$key' by properties.get('key').

Unlike shell, undefined variables are left as-is (this behavior is the same as Ant.)


replaceMacro

public static java.lang.String replaceMacro(java.lang.String s,
                                            VariableResolver<java.lang.String> resolver)
Replaces the occurrence of '$key' by resolver.get('key').

Unlike shell, undefined variables are left as-is (this behavior is the same as Ant.)


fixNull

public static java.lang.String fixNull(java.lang.String s)
Convert null to "".


fixEmpty

public static java.lang.String fixEmpty(java.lang.String s)
Convert empty string to null.


fixEmptyAndTrim

public static java.lang.String fixEmptyAndTrim(java.lang.String s)
Convert empty string to null, and trim whitespace.

Since:
1.154

fixNull

public static <T> java.util.List<T> fixNull(java.util.List<T> l)

fixNull

public static <T> java.util.Set<T> fixNull(java.util.Set<T> l)

fixNull

public static <T> java.util.Collection<T> fixNull(java.util.Collection<T> l)

fixNull

public static <T> java.lang.Iterable<T> fixNull(java.lang.Iterable<T> l)

join

public static java.lang.String join(java.util.Collection<?> strings,
                                    java.lang.String separator)
Concatenate multiple strings by inserting a separator.


join

public static <T> java.util.List<T> join(java.util.Collection<? extends T>... items)
Combines all the given collections into a single list.



Copyright © 2005-2010 PMEase Inc. All Rights Reserved.