Class TypeUtils


  • public abstract class TypeUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TypeUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String format​(java.lang.String messagePattern, java.lang.Object... args)
      Compatible with slf4j.
      static java.util.GregorianCalendar getHundredYearsAgo()  
      static java.util.GregorianCalendar getThousandYearsAgo()  
      static java.util.GregorianCalendar getThousandYearsFromNow()  
      (package private) static boolean isSameDate​(java.util.Calendar aCal1, java.util.Calendar aCal2)  
      (package private) static boolean isSameTime​(java.util.Calendar aCal1, java.util.Calendar aCal2)  
      static java.math.BigDecimal toBigDecimal​(java.lang.Comparable<?> number)
      If the input java.lang.Comparale is a BigDecimal it is passed through unaltered.
      static java.math.BigDecimal toBigDecimal​(java.lang.Comparable<?> number, NumberContext context)  
      static java.lang.String toHexString​(int colour)
      The way colours are specified in html pages.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TypeUtils

        protected TypeUtils()
    • Method Detail

      • format

        public static java.lang.String format​(java.lang.String messagePattern,
                                              java.lang.Object... args)
        Compatible with slf4j. {} in the message pattern will be replaced by the arguments.
      • getHundredYearsAgo

        public static final java.util.GregorianCalendar getHundredYearsAgo()
      • getThousandYearsAgo

        public static final java.util.GregorianCalendar getThousandYearsAgo()
      • getThousandYearsFromNow

        public static final java.util.GregorianCalendar getThousandYearsFromNow()
      • toBigDecimal

        public static java.math.BigDecimal toBigDecimal​(java.lang.Comparable<?> number)
        If the input java.lang.Comparale is a BigDecimal it is passed through unaltered. Otherwise an equivalent BigDecimal is created. ALWAYS returns a valid BigDecimal instance - which, among other things, means that null and NaN are replaced by 0.0 (zero).
        Parameters:
        number - Any Number
        Returns:
        A corresponding BigDecimal
      • toBigDecimal

        public static java.math.BigDecimal toBigDecimal​(java.lang.Comparable<?> number,
                                                        NumberContext context)
      • toHexString

        public static java.lang.String toHexString​(int colour)
        The way colours are specified in html pages.
      • isSameDate

        static boolean isSameDate​(java.util.Calendar aCal1,
                                  java.util.Calendar aCal2)
      • isSameTime

        static boolean isSameTime​(java.util.Calendar aCal1,
                                  java.util.Calendar aCal2)