net.sf.freecol.common.util
Class Utils

java.lang.Object
  extended by net.sf.freecol.common.util.Utils

public class Utils
extends java.lang.Object

Collection of small static helper methods.


Constructor Summary
Utils()
           
 
Method Summary
static boolean equals(java.lang.Object one, java.lang.Object two)
          Will check if both objects are equal but also checks for null.
static java.lang.String getUserDirectory()
          Generalize this method instead of calling it directly elsewhere.
static java.lang.String join(java.lang.String delimiter, java.util.List<java.lang.String> strings)
          Joins the given strings.
static java.lang.String join(java.lang.String delimiter, java.lang.String... strings)
          Joins the given strings.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

join

public static java.lang.String join(java.lang.String delimiter,
                                    java.lang.String... strings)
Joins the given strings.

Parameters:
delimiter - The delimiter to place between the individual strings.
strings - The strings to be joined.
Returns:
Each of the strings in the given array delimited by the given string.

join

public static java.lang.String join(java.lang.String delimiter,
                                    java.util.List<java.lang.String> strings)
Joins the given strings.

Parameters:
delimiter - The delimiter to place between the individual strings.
strings - The strings to be joined.
Returns:
Each of the strings in the given array delimited by the given string.

equals

public static boolean equals(java.lang.Object one,
                             java.lang.Object two)
Will check if both objects are equal but also checks for null.

Parameters:
one - First object to compare
two - Second object to compare
Returns:
(one == null && two != null) || (one != null && one.equals(two))

getUserDirectory

public static java.lang.String getUserDirectory()
Generalize this method instead of calling it directly elsewhere.

Returns:
String