Packages

object TimeHelpers extends TimeHelpers with ControlHelpers with ClassHelpers

The TimeHelpers object extends the TimeHelpers. It can be imported to access all of the trait functions.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TimeHelpers
  2. ControlHelpers
  3. Tryo
  4. ClassHelpers
  5. TimeHelpers
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class CalendarExtension extends AnyRef

    This class adds the setXXX methods to the Calendar class.

    This class adds the setXXX methods to the Calendar class. Each setter returns the updated Calendar

    Definition Classes
    TimeHelpers
  2. class DateExtension extends AnyRef

    This class adds a noTime method the Date class, in order to get at Date object starting at 00:00

    This class adds a noTime method the Date class, in order to get at Date object starting at 00:00

    Definition Classes
    TimeHelpers
  3. implicit class DateTimeExtension extends AnyRef
    Definition Classes
    TimeHelpers
  4. implicit class PeriodExtension [P] extends AnyRef
    Definition Classes
    TimeHelpers
  5. class TimeSpan extends ConvertableToDate

    The TimeSpan class represents a duration of time in milliseconds.

    The TimeSpan class represents a duration of time in milliseconds. In this way, it is similar to the scala.concurrent.Duration class. It is mostly used in Lift APIs in similar positions as the Scala Duration class (for example, in event scheduling).

    Unlike in the Lift 2.x series, building a TimeSpan with a Long will not have different behavior depending on the value passed. Any passed Long will be used as a duration.

    Prior to Lift 3.0, TimeSpan was an amalgam of duration and joda DateTime, and allowed conversions between the two. As a result, operational semantics were poorly defined and it was easy to call a method that seemed like it should have simple duration semantics but run into DateTime semantics that made things more complicated instead.

    Lift 3.0 mostly maintains API compatibility with the Lift 2.x series, but introduces a series of deprecations to indicate places where dangerous and potentially unclear behavior may occur. Lift 3.1 will maintain API compatibility with all non-deprecated parts of the TimeSpan API, but will remove the deprecated aspects.

    For deprecated years and month builders it handle an operations on duration field values. Then it could be used only in to-period implicit conversion.

    Definition Classes
    TimeHelpers
  6. case class TimeSpanBuilder (len: Long) extends Product with Serializable

    class building TimeSpans given an amount (len) and a method specify the time unit

    class building TimeSpans given an amount (len) and a method specify the time unit

    Definition Classes
    TimeHelpers

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def ^[T](i: T*): List[T]

    This operator transforms its arguments into a List

    This operator transforms its arguments into a List

    returns

    the list of arguments passed as varargs

    Definition Classes
    ClassHelpers
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def boxParseInternetDate(dateString: String): Box[Date]

    returns

    a Box[date] from a string using the internet format.

    Definition Classes
    TimeHelpers
  7. def calcTime[T](f: ⇒ T): (Long, T)

    returns

    the time taken to evaluate f in millis and the result

    Definition Classes
    TimeHelpers
  8. def callableMethod_?(meth: Method): Boolean

    returns

    true if the method is public and has no parameters

    Definition Classes
    ClassHelpers
  9. def classHasControllerMethod(clz: Class[_], name: String): Boolean

    Check that the method 'name' is callable for class 'clz'

    Check that the method 'name' is callable for class 'clz'

    clz

    the class supposed to own the method

    name

    name of the method to test

    returns

    true if the method exists on the class and is callable

    Definition Classes
    ClassHelpers
  10. def classHierarchy(in: Class[_]): List[Class[_]]
    Definition Classes
    ClassHelpers
  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def containsClass[C](clz: Class[C], toMatch: List[Class[_]]): Boolean

    Is the clz an instance of (assignable from) any of the classes in the list

    Is the clz an instance of (assignable from) any of the classes in the list

    clz

    the class to test

    toMatch

    the list of classes to match against

    returns

    true if clz is assignable from any of the matching classes

    Definition Classes
    ClassHelpers
  13. def createInvoker[C <: AnyRef](name: String, on: C): Box[() ⇒ Box[Any]]

    Create a function (the 'invoker') which will trigger any public, parameterless method That function will throw the cause exception if the method can't be invoked

    Create a function (the 'invoker') which will trigger any public, parameterless method That function will throw the cause exception if the method can't be invoked

    on

    instance whose method must be invoked

    returns

    Empty if instance is null or Full(invoker)

    Definition Classes
    ClassHelpers
  14. def currentYear: Int

    returns

    the current year

    Definition Classes
    TimeHelpers
  15. def dateFormatter: SimpleDateFormat

    returns

    a standard format for the date yyyy/MM/dd

    Definition Classes
    TimeHelpers
  16. def day(in: Date): Int

    returns

    the day of month corresponding to the input date (1 based)

    Definition Classes
    TimeHelpers
  17. def days(in: Long): Long

    returns

    the number of millis corresponding to 'in' days

    Definition Classes
    TimeHelpers
  18. def daysSinceEpoch: Long

    returns

    the number of days since epoch

    Definition Classes
    TimeHelpers
  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  21. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. def findClass(where: List[(String, List[String])]): Box[Class[AnyRef]]

    Find a class given a list of possible names and corresponding packages, turning underscored names to CamelCase if necessary

    Find a class given a list of possible names and corresponding packages, turning underscored names to CamelCase if necessary

    returns

    a Box, either containing the found class or an Empty can.

    Definition Classes
    ClassHelpers
  23. def findClass(name: String, where: List[String]): Box[Class[AnyRef]]

    Find a class given its name and a list of packages, turning underscored names to CamelCase if necessary.

    Find a class given its name and a list of packages, turning underscored names to CamelCase if necessary.

    returns

    a Box, either containing the found class or an Empty can.

    Definition Classes
    ClassHelpers
  24. def findClass[C <: AnyRef](name: String, where: List[String], targetType: Class[C]): Box[Class[C]]

    Find a class given its name and a list of packages, turning underscored names to CamelCase if necessary.

    Find a class given its name and a list of packages, turning underscored names to CamelCase if necessary.

    returns

    a Box, either containing the found class or an Empty can.

    Definition Classes
    ClassHelpers
  25. def findClass(name: String, where: List[String], modifiers: List[(String) ⇒ String]): Box[Class[AnyRef]]

    General method to in find a class according to its name, a list of possible packages and a list of functions modifying the given name create a target name to look for (e.g: 'name' is hello_world and the target name may be 'HelloWorld').

    General method to in find a class according to its name, a list of possible packages and a list of functions modifying the given name create a target name to look for (e.g: 'name' is hello_world and the target name may be 'HelloWorld').

    returns

    a Box, either containing the found class or an Empty can.

    Definition Classes
    ClassHelpers
  26. def findClass[C <: AnyRef](name: String, where: List[String], modifiers: List[(String) ⇒ String], targetType: Class[C]): Box[Class[C]]

    General method to in find a class according to its name, a list of possible packages, a list of functions modifying the given name create a target name to look for (e.g: 'name' is hello_world and the target name may be 'HelloWorld').

    General method to in find a class according to its name, a list of possible packages, a list of functions modifying the given name create a target name to look for (e.g: 'name' is hello_world and the target name may be 'HelloWorld').

    returns

    a Box, either containing the found class or an Empty can.

    Definition Classes
    ClassHelpers
  27. def findType[C <: AnyRef](where: List[(String, List[String])])(implicit m: Manifest[C]): Box[Class[C]]

    Find a class given its type, a list of possible names and corresponding packages, turning underscored names to CamelCase if necessary

    Find a class given its type, a list of possible names and corresponding packages, turning underscored names to CamelCase if necessary

    returns

    a Box, either containing the found class or an Empty can.

    Definition Classes
    ClassHelpers
  28. def findType[C <: AnyRef](name: String, where: List[String])(implicit m: Manifest[C]): Box[Class[C]]

    Find a class given its type, its name and a list of packages, turning underscored names to CamelCase if necessary.

    Find a class given its type, its name and a list of packages, turning underscored names to CamelCase if necessary.

    returns

    a Box, either containing the found class or an Empty can.

    Definition Classes
    ClassHelpers
  29. def findType[C <: AnyRef](name: String, where: List[String], modifiers: List[(String) ⇒ String])(implicit m: Manifest[C]): Box[Class[C]]

    General method to in find a class according to its type, its name, a list of possible packages and a list of functions modifying the given name create a target name to look for (e.g: 'name' is hello_world and the target name may be 'HelloWorld').

    General method to in find a class according to its type, its name, a list of possible packages and a list of functions modifying the given name create a target name to look for (e.g: 'name' is hello_world and the target name may be 'HelloWorld').

    returns

    a Box, either containing the found class or an Empty can.

    Definition Classes
    ClassHelpers
  30. def formattedDateNow: String

    returns

    today's date formatted as yyyy/MM/dd

    Definition Classes
    TimeHelpers
  31. def formattedTimeNow: String

    returns

    now's time formatted as HH:mm zzz

    Definition Classes
    TimeHelpers
  32. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  33. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  34. def hourFormat(in: Date): String

    returns

    the formatted time for a given Date

    Definition Classes
    TimeHelpers
  35. def hourFormat: SimpleDateFormat

    returns

    a standard format HH:mm:ss

    Definition Classes
    TimeHelpers
  36. def hours(in: Long): Long

    returns

    the number of millis corresponding to 'in' hours

    Definition Classes
    TimeHelpers
  37. def instantiate[C](clz: Class[C]): Box[C]

    Create a new instance of a class

    Create a new instance of a class

    returns

    a Full can with the instance or a Failure if the instance can't be created

    Definition Classes
    ClassHelpers
  38. implicit def intToTimeSpanBuilder(in: Int): TimeSpanBuilder

    transforms an int to a TimeSpanBuilder object.

    transforms an int to a TimeSpanBuilder object. Usage: 3.seconds returns a TimeSpan of 3000L millis

    Definition Classes
    TimeHelpers
  39. def internetDateFormatter: SimpleDateFormat

    returns

    a formatter for internet dates (RFC822/1123) including: the day of week, the month, day of month, time and time zone

    Definition Classes
    TimeHelpers
  40. def invokeControllerMethod(clz: Class[_], meth: String): Any

    Invoke a controller method (parameterless, public) on a class

    Invoke a controller method (parameterless, public) on a class

    clz

    the class owning the method

    returns

    the result of the method invocation or throws the root exception causing an error

    Definition Classes
    ClassHelpers
  41. def invokeMethod[C](clz: Class[C], inst: AnyRef, meth: String, params: Array[AnyRef], ptypes: Array[Class[_]]): Box[Any]

    Invoke the given method for the given class, with some parameters and their types Tries the method name, then the method as a CamelCased name and the method as a camelCased name The class is not instanciated if the method is static, otherwise the passed instance is used

    Invoke the given method for the given class, with some parameters and their types Tries the method name, then the method as a CamelCased name and the method as a camelCased name The class is not instanciated if the method is static, otherwise the passed instance is used

    clz

    class whose method should be invoked

    inst

    instance of the class who method should be invoked, if the method is not static

    meth

    method to invoke

    params

    parameters to pass to the method

    ptypes

    list of types of the parameters

    returns

    a Box containing the value returned by the method

    Definition Classes
    ClassHelpers
  42. def invokeMethod[C](clz: Class[C], inst: AnyRef, meth: String, params: Array[AnyRef]): Box[Any]

    Invoke the given method for the given class, with some parameters.

    Invoke the given method for the given class, with some parameters. Tries the method name, then the method as a CamelCased name and the method as a camelCased name The class is not instanciated if the method is static, otherwise the passed instance is used

    clz

    class whose method should be invoked

    inst

    instance of the class who method should be invoked, if the method is not static

    meth

    method to invoke

    params

    parameters to pass to the method

    returns

    a Box containing the value returned by the method

    Definition Classes
    ClassHelpers
  43. def invokeMethod[C](clz: Class[C], inst: AnyRef, meth: String): Box[Any]

    Invoke the given method for the given class, with no params.

    Invoke the given method for the given class, with no params. The class is not instanciated if the method is static, otherwise the passed instance is used

    clz

    class whose method should be invoked

    inst

    instance of the class who method should be invoked, if the method is not static

    meth

    method to invoke

    returns

    a Box containing the value returned by the method

    Definition Classes
    ClassHelpers
  44. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  45. def logTime[T](f: ⇒ (String, T)): T

    Call f and log the string returned together with the time taken in millis.

    Call f and log the string returned together with the time taken in millis.

    returns

    the second result from f

    Definition Classes
    TimeHelpers
  46. def logTime[T](msg: String)(f: ⇒ T): T

    Log a message with the time taken in millis to do something and return the result

    Log a message with the time taken in millis to do something and return the result

    returns

    the result

    Definition Classes
    TimeHelpers
  47. implicit def longToTimeSpanBuilder(in: Long): TimeSpanBuilder

    transforms a long to a TimeSpanBuilder object.

    transforms a long to a TimeSpanBuilder object. Usage: 3L.seconds returns a TimeSpan of 3000L millis

    Definition Classes
    TimeHelpers
  48. def millis: Long

    returns

    the current number of millis: System.currentTimeMillis

    Definition Classes
    TimeHelpers
  49. def millisToDays(millis: Long): Long

    returns

    the number of days since epoch converted from millis

    Definition Classes
    TimeHelpers
  50. def minutes(in: Long): Long

    returns

    the number of millis corresponding to 'in' minutes

    Definition Classes
    TimeHelpers
  51. def month(in: Date): Int

    returns

    the month corresponding to today (0 based, relative to UTC)

    Definition Classes
    TimeHelpers
  52. def nano: Long

    returns

    the current System.nanoTime()

    Definition Classes
    TimeHelpers
  53. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  54. final def notify(): Unit
    Definition Classes
    AnyRef
  55. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  56. def now: Date

    returns

    the date object for now

    Definition Classes
    TimeHelpers
  57. def nowAsInternetDate: String

    returns

    the current time as an internet date

    Definition Classes
    TimeHelpers
  58. def parseInternetDate(dateString: String): Date

    returns

    a date from a string using the internet format. Return the Epoch date if the parse is unsuccesful

    Definition Classes
    TimeHelpers
  59. def seconds(in: Long): Long

    returns

    the number of millis corresponding to 'in' seconds

    Definition Classes
    TimeHelpers
  60. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  61. def time(when: Long): Date

    alias for new Date(millis)

    alias for new Date(millis)

    Definition Classes
    TimeHelpers
  62. def timeFormatter: SimpleDateFormat

    returns

    a format for the time which includes the TimeZone: HH:mm zzz

    Definition Classes
    TimeHelpers
  63. implicit def toCalendarExtension(c: Calendar): CalendarExtension

    implicit def used to add the setXXX methods to the Calendar class

    implicit def used to add the setXXX methods to the Calendar class

    Definition Classes
    TimeHelpers
  64. def toDate(in: Any): Box[Date]

    returns

    a Full(date) or a failure if the input couldn't be translated to date (or Empty if the input is null)

    Definition Classes
    TimeHelpers
  65. implicit def toDateExtension(d: Date): DateExtension

    implicit def used to add the noTime method to the Date class

    implicit def used to add the noTime method to the Date class

    Definition Classes
    TimeHelpers
  66. def toInternetDate(in: Long): String

    returns

    a date formatted with the internet format (from a number of millis)

    Definition Classes
    TimeHelpers
  67. def toInternetDate(in: Date): String

    returns

    a date formatted with the internet format

    Definition Classes
    TimeHelpers
  68. def toString(): String
    Definition Classes
    AnyRef → Any
  69. def today: Calendar

    returns

    the Calendar object for today (the TimeZone is the local TimeZone). Its time is 00:00:00.000

    Definition Classes
    TimeHelpers
  70. def tryo[T](ignore: Class[_])(f: ⇒ T): Box[T]

    Wraps a "try" block around the function f.

    Wraps a "try" block around the function f. Takes only one Class of exception to ignore

    ignore

    - a single exception classes to ignore. A thrown exception will be ignored if it is assignable from this class.

    f

    - the block of code to evaluate

    returns

    • Full(result of the evaluation of f) if f doesn't throw any exception
    • a Failure if f throws an exception
    • Empty if the exception class is in the ignore list
    Definition Classes
    Tryo
  71. def tryo[T](ignore: List[Class[_]])(f: ⇒ T): Box[T]

    Wraps a "try" block around the function f

    Wraps a "try" block around the function f

    ignore

    - a list of exception classes to ignore. A thrown exception will be ignored if it is assignable from one of the exception classes in the list

    f

    - the block of code to evaluate

    returns

    • Full(result of the evaluation of f) if f doesn't throw any exception
    • a Failure if f throws an exception
    • Empty if the exception class is in the ignore list
    Definition Classes
    Tryo
  72. def tryo[T](onError: (Throwable) ⇒ Unit)(f: ⇒ T): Box[T]

    Wraps a "try" block around the function f and trigger a callback function if an exception is thrown

    Wraps a "try" block around the function f and trigger a callback function if an exception is thrown

    onError

    - an optional callback function that will use the thrown exception as a parameter

    f

    - the block of code to evaluate

    returns

    • Full(result of the evaluation of f) if f doesn't throw any exception
    • a Failure if f throws an exception
    Definition Classes
    Tryo
  73. def tryo[T](f: ⇒ T): Box[T]

    Wraps a "try" block around the function f

    Wraps a "try" block around the function f

    f

    - the block of code to evaluate

    returns

    • Full(result of the evaluation of f) if f doesn't throw any exception
    • a Failure if f throws an exception
    Definition Classes
    Tryo
  74. def tryo[T](handler: PartialFunction[Throwable, T], f: ⇒ T): Box[T]

    Wraps a "try" block around the function f.

    Wraps a "try" block around the function f. If f throws an exception that is in the domain of the handler PF, the handler will be invoked on the exception. Otherwise the exception is wrapped into a Failure.

    handler

    - A partial function that handles exceptions

    f

    - the block of code to evaluate

    returns

    • Full(result of the evaluation of f) if f doesn't throw any exception
    • a Failure if f throws an exception
    Definition Classes
    Tryo
    See also

    net.liftweb.common.Failure

  75. def tryo[T](ignore: List[Class[_]], onError: Box[(Throwable) ⇒ Unit])(f: ⇒ T): Box[T]

    Wraps a "try" block around the function f.

    Wraps a "try" block around the function f. If f throws an exception with its class in the 'ignore' list or if 'ignore' is null or an empty list, ignore the exception and return None.

    ignore

    - a list of exception classes to ignore. A thrown exception will be ignored if it is assignable from one of the exception classes in the list

    onError

    - an optional callback function that will use the thrown exception as a parameter

    f

    - the block of code to evaluate

    returns

    • Full(result of the evaluation of f) if f doesn't throw any exception
    • a Failure if f throws an exception
    • Empty if the exception class is in the ignore list
    Definition Classes
    Tryo
  76. val utc: TimeZone

    The UTC TimeZone

    The UTC TimeZone

    Definition Classes
    TimeHelpers
  77. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  78. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  79. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  80. def weeks(in: Long): Long

    returns

    the number of millis corresponding to 'in' weeks

    Definition Classes
    TimeHelpers
  81. def year(in: Date): Int

    returns

    the year corresponding to today (relative to UTC)

    Definition Classes
    TimeHelpers
  82. object TimeSpan

    The TimeSpan object provides class represents an amount of time.

    The TimeSpan object provides class represents an amount of time. It can be translated to a date with the date method. In that case, the number of millis seconds will be used to create a Date object starting from the Epoch time (see the documentation for java.util.Date)

    Definition Classes
    TimeHelpers

Deprecated Value Members

  1. implicit def intToTimeSpan(in: Int): TimeSpan

    transforms an int to a TimeSpan object.

    transforms an int to a TimeSpan object. Usage: 3000 returns a TimeSpan of 3000L millis

    Definition Classes
    TimeHelpers
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Int to TimeSpan conversion will be removed for possibility of ambiguous behaviours, use TimeSpan(in) instead if you are using in.millis

  2. implicit def longToTimeSpan(in: Long): TimeSpan

    transforms a long to a TimeSpan object.

    transforms a long to a TimeSpan object. Usage: 3000L returns a TimeSpan of 3000L millis

    Definition Classes
    TimeHelpers
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0.0) Long to TimeSpan conversion will be removed for possibility of ambiguous behaviours, use TimeSpan(in) instead if you are using in.millis

Inherited from ControlHelpers

Inherited from Tryo

Inherited from ClassHelpers

Inherited from TimeHelpers

Inherited from AnyRef

Inherited from Any

Ungrouped