com.alee.utils
Class CompareUtils

java.lang.Object
  extended by com.alee.utils.CompareUtils

public final class CompareUtils
extends java.lang.Object

This class provides a set of utilities to compare various objects.

Author:
Mikle Garin

Constructor Summary
CompareUtils()
           
 
Method Summary
static boolean contains(java.lang.String text, java.util.List<java.lang.String> tokens)
          Returns whether text contains any of the tokens from the specified list or not.
static boolean equals(java.util.Date d1, java.util.Date d2)
          Returns whether the first Date equals to the second Date or not.
static boolean equals(java.lang.Object o1, java.lang.Object o2)
          Returns whether the first Object equals to the second Object or not.
static boolean equals(java.lang.String s1, java.lang.String s2)
          Returns whether the first String equals to the second String or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompareUtils

public CompareUtils()
Method Detail

equals

public static boolean equals(java.lang.String s1,
                             java.lang.String s2)
Returns whether the first String equals to the second String or not. This method will compare two String objects even if they are null without throwing any exceptions. This method should not be called from any method that overrides object default "equals" method.

Parameters:
s1 - first String
s2 - second String
Returns:
true if the first String equals to the second String, false otherwise

equals

public static boolean equals(java.util.Date d1,
                             java.util.Date d2)
Returns whether the first Date equals to the second Date or not. This method will compare two Date objects even if they are null without throwing any exceptions. This method should not be called from any method that overrides object default "equals" method.

Parameters:
d1 - first Date
d2 - second Date
Returns:
true if the first Date equals to the second Date, false otherwise

equals

public static boolean equals(java.lang.Object o1,
                             java.lang.Object o2)
Returns whether the first Object equals to the second Object or not. This method will compare two objects even if they are null without throwing any exceptions. This method should not be called from any method that overrides object default "equals" method.

Parameters:
o1 - first Object
o2 - second Object
Returns:
true if the first Object equals to the second Object, false otherwise

contains

public static boolean contains(java.lang.String text,
                               java.util.List<java.lang.String> tokens)
Returns whether text contains any of the tokens from the specified list or not.

Parameters:
text - text to look for tokens
tokens - tokens list
Returns:
true if text contains any of the tokens from the specified list, false otherwise