code: @SuppressWarnings({ "rawtypes", "unchecked" })
      public static int compareTo(final Comparable thisValue, final Comparable otherValue, final OrderDirection orderDirection, final OrderDirection nullOrderDirection) {
          if (null == thisValue && null == otherValue) {
              return 0;
          }
          if (null == thisValue) {
              return orderDirection == nullOrderDirection ? -1 : 1;
          }
          if (null == otherValue) {
              return orderDirection == nullOrderDirection ? 1 : -1;
          }
          return OrderDirection.ASC == orderDirection ? thisValue.compareTo(otherValue) : -thisValue.compareTo(otherValue);
      }
docs: Compare two object with order type.
  
  @param thisValue this value
  @param otherValue other value
  @param orderDirection order direction
  @param nullOrderDirection order direction for null value
  @return compare result