Packages

o

net.liftweb.util

Helpers

object Helpers extends TimeHelpers with StringHelpers with ListHelpers with SecurityHelpers with HtmlHelpers with HttpHelpers with IoHelpers with BasicTypesHelpers with ClassHelpers with ControlHelpers

The Helpers object provides a lot of utility functions:

  • Time and date
  • URL
  • Hash generation
  • Class instantiation
  • Control abstractions
  • Basic types conversions
  • XML bindings
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Helpers
  2. ControlHelpers
  3. Tryo
  4. ClassHelpers
  5. BasicTypesHelpers
  6. IoHelpers
  7. HttpHelpers
  8. HtmlHelpers
  9. CssBindImplicits
  10. SecurityHelpers
  11. ListHelpers
  12. StringHelpers
  13. TimeHelpers
  14. AnyRef
  15. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit class Boolean2 extends AnyRef

    This decorator class adds a ternary operator to a Boolean value

    This decorator class adds a ternary operator to a Boolean value

    Definition Classes
    BasicTypesHelpers
  2. implicit class OptionExtension [T] extends AnyRef
    Definition Classes
    BasicTypesHelpers
  3. implicit final class OptionalCons extends AnyRef

    Optional cons that implements the expression: expr ?> value ::: List

    Optional cons that implements the expression: expr ?> value ::: List

    Definition Classes
    BasicTypesHelpers
  4. implicit final class PartialFunctionWrapper [A] extends AnyRef

    A helper class that facilitates wrapping of one PartialFunction around another

    A helper class that facilitates wrapping of one PartialFunction around another

    Definition Classes
    BasicTypesHelpers
  5. implicit class TryExtension [T] extends AnyRef
    Definition Classes
    BasicTypesHelpers
  6. class CssBindPromoter extends AnyRef
    Definition Classes
    CssBindImplicits
  7. implicit class CssSelectorToCssBindPromoter extends CssBindPromoter
    Definition Classes
    CssBindImplicits
  8. implicit class StringToCssBindPromoter extends CssBindPromoter
    Definition Classes
    CssBindImplicits
  9. class ListMapish extends AnyRef

    This class add a case insensitive get to a List of Pairs of String, as if it was a Map

    This class add a case insensitive get to a List of Pairs of String, as if it was a Map

    Definition Classes
    ListHelpers
  10. implicit class SuperList [T] extends AnyRef

    Add utility methods to Lists

    Add utility methods to Lists

    Definition Classes
    ListHelpers
  11. 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
  12. 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
  13. implicit class DateTimeExtension extends AnyRef
    Definition Classes
    TimeHelpers
  14. implicit class PeriodExtension [P] extends AnyRef
    Definition Classes
    TimeHelpers
  15. 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
  16. 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. object AsBoolean

    A helpful Boolean extractor

    A helpful Boolean extractor

    Definition Classes
    BasicTypesHelpers
  2. object AsDouble

    A helpful Double extractor

    A helpful Double extractor

    Definition Classes
    BasicTypesHelpers
  3. object AsInt

    A helpful Int extractor

    A helpful Int extractor

    Definition Classes
    BasicTypesHelpers
  4. object AsLong

    A helpful Long extractor

    A helpful Long extractor

    Definition Classes
    BasicTypesHelpers
  5. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def ##(): Int
    Definition Classes
    AnyRef → Any
  7. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. 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
  9. def addCssClass(cssClass: String, elem: Elem): Elem

    Adds the specified cssClass to the existing class attribute of an Elem or creates the class attribute with that class if it does not exist.

    Adds the specified cssClass to the existing class attribute of an Elem or creates the class attribute with that class if it does not exist.

    Definition Classes
    HtmlHelpers
  10. def addCssClass(cssClass: Box[String], elem: Elem): Elem

    Adds the specified cssClass to the existing class attribute of an Elem or create the class attribute with that class if it does not exist.

    Adds the specified cssClass to the existing class attribute of an Elem or create the class attribute with that class if it does not exist.

    If cssClass is not Full, returns the passed Elem unchanged.

    Definition Classes
    HtmlHelpers
  11. def appendFuncToURL(url: String, funcStr: String): String

    Given a URL and a Lift function String, append the function even if the URL has query params and a #

    Given a URL and a Lift function String, append the function even if the URL has query params and a #

    Definition Classes
    HttpHelpers
  12. def appendParams(url: String, params: Seq[(String, String)]): String

    Append parameters to a URL

    Append parameters to a URL

    url

    the url to append the params to

    params

    the parameters (name/value) to append to the URL

    returns

    the url with the parameters appended

    Definition Classes
    HttpHelpers
  13. def appendQueryParameters(url: String, params: List[(String, String)]): String

    Given a list of query parameters, append them to the URL taking into account # and if there are any other query parameters

    Given a list of query parameters, append them to the URL taking into account # and if there are any other query parameters

    Definition Classes
    HttpHelpers
  14. def asBoolean(in: String): Box[Boolean]

    A helper that will convert the String to a Boolean if it's t, true, yes, 1, f, false, no, or 0

    A helper that will convert the String to a Boolean if it's t, true, yes, 1, f, false, no, or 0

    Definition Classes
    BasicTypesHelpers
  15. def asDouble(in: String): Box[Double]

    Safely convert the specified String to a Double.

    Safely convert the specified String to a Double.

    Definition Classes
    BasicTypesHelpers
  16. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  17. def asInt(in: String): Box[Int]

    Safely convert the specified String to an Int.

    Safely convert the specified String to an Int.

    Definition Classes
    BasicTypesHelpers
  18. def asLong(in: Any): Box[Long]

    Convert any object to an "equivalent" Long depending on its value

    Convert any object to an "equivalent" Long depending on its value

    Definition Classes
    BasicTypesHelpers
  19. def asLong(in: String): Box[Long]

    Safely convert the specified String to a Long.

    Safely convert the specified String to a Long.

    Definition Classes
    BasicTypesHelpers
  20. def base64Decode(in: String): Array[Byte]

    decode a String in Base 64

    decode a String in Base 64

    Definition Classes
    SecurityHelpers
  21. def base64Encode(in: Array[Byte]): String

    encode a Byte array in Base 64

    encode a Byte array in Base 64

    Definition Classes
    SecurityHelpers
  22. def base64EncodeURLSafe(in: Array[Byte]): String

    encode a Byte array in Base 64 in a way that's safe for use in URLs

    encode a Byte array in Base 64 in a way that's safe for use in URLs

    Definition Classes
    SecurityHelpers
  23. def blankForNull(s: String): String

    Test for null and return either the given String if not null or the blank String.

    Test for null and return either the given String if not null or the blank String.

    Definition Classes
    StringHelpers
  24. def boxParseInternetDate(dateString: String): Box[Date]

    returns

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

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

    returns

    the time taken to evaluate f in millis and the result

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

    returns

    true if the method is public and has no parameters

    Definition Classes
    ClassHelpers
  27. def camelify(name: String): String

    Turns a string of format "foo_bar" into camel case "FooBar"

    Turns a string of format "foo_bar" into camel case "FooBar"

    Functional code courtesy of Jamie Webb (j@jmawebb.cjb.net) 2006/11/28

    name

    the String to CamelCase

    returns

    the CamelCased string

    Definition Classes
    StringHelpers
  28. def camelifyMethod(name: String): String

    Turn a string of format "foo_bar" into camel case with the first letter in lower case: "fooBar" This function is especially used to camelCase method names.

    Turn a string of format "foo_bar" into camel case with the first letter in lower case: "fooBar" This function is especially used to camelCase method names.

    name

    the String to CamelCase

    returns

    the CamelCased string

    Definition Classes
    StringHelpers
  29. def capify(in: String): String

    Capitalize every "word" in the string.

    Capitalize every "word" in the string. A word is either separated by spaces or underscores.

    in

    string to capify

    returns

    the capified string

    Definition Classes
    StringHelpers
  30. def charSplit(what: String, sep: Char): List[String]

    Faster than roboSplit...

    Faster than roboSplit... this method splits Strings at a given character

    Definition Classes
    StringHelpers
  31. 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
  32. def classHierarchy(in: Class[_]): List[Class[_]]
    Definition Classes
    ClassHelpers
  33. def clean(in: String): String

    Remove all the characters from a string exception a-z, A-Z, 0-9, and '_'

    Remove all the characters from a string exception a-z, A-Z, 0-9, and '_'

    returns

    the cleaned string and an empty string if the input is null

    Definition Classes
    StringHelpers
  34. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. def commafy(what: String): String

    Add commas before the last 3 characters

    Add commas before the last 3 characters

    returns

    the string with commas

    Definition Classes
    StringHelpers
  36. def compareElem(left: Elem, right: Elem): Boolean

    Compare two Elems

    Compare two Elems

    Definition Classes
    BasicTypesHelpers
  37. def compareMetaData(left: List[MetaData], right: List[MetaData]): Boolean

    Compare the metadata of two attributes

    Compare the metadata of two attributes

    Definition Classes
    BasicTypesHelpers
  38. def compareNode(left: Node, right: Node): Boolean

    Comparse two XML nodes

    Comparse two XML nodes

    Definition Classes
    BasicTypesHelpers
  39. def compareXml(left: NodeSeq, right: NodeSeq): Boolean

    Compare two NodeSeq and return true if they are equal, even if attribute order of Elems is different

    Compare two NodeSeq and return true if they are equal, even if attribute order of Elems is different

    Definition Classes
    BasicTypesHelpers
  40. 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
  41. def couldBeHtml(in: Map[String, String]): Boolean

    Given a map of HTTP properties, return true if the "Content-type" value in the map is either "text/html" or "application/xhtml+xml"

    Given a map of HTTP properties, return true if the "Content-type" value in the map is either "text/html" or "application/xhtml+xml"

    in

    Map which may contain a key named Content-Type

    returns

    true if there is a pair ("Content-Type", "text/html") or ("Content-Type", "application/xhtml+xml")

    Definition Classes
    HttpHelpers
  42. 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
  43. def currentYear: Int

    returns

    the current year

    Definition Classes
    TimeHelpers
  44. def dateFormatter: SimpleDateFormat

    returns

    a standard format for the date yyyy/MM/dd

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

    returns

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

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

    returns

    the number of millis corresponding to 'in' days

    Definition Classes
    TimeHelpers
  47. def daysSinceEpoch: Long

    returns

    the number of days since epoch

    Definition Classes
    TimeHelpers
  48. def deepEnsureUniqueId(in: NodeSeq): NodeSeq

    For a list of NodeSeq, ensure that the the id of all Elems are unique, recursively.

    For a list of NodeSeq, ensure that the the id of all Elems are unique, recursively. If there's a duplicate, that Elem will be returned without an id.

    Definition Classes
    HtmlHelpers
  49. def deepFindKids(in: NodeSeq, prefix: String, label: String): NodeSeq
    Definition Classes
    HttpHelpers
  50. def delta[T, Res](old: Seq[T], newList: Seq[T])(f: (DeltaInfo[T]) ⇒ Res): List[Res]

    Compute the deltas between two sequences of a given type.

    Compute the deltas between two sequences of a given type. Apply the function based on the differences between the two lists. The resulting List of commands will be returned. The algorithm used to calculate the diffs is not very efficient and can degrade to O(n^2), so it's not great for large collections. Internally the Seq[T] are converted to a List[T]. Finally, it's highly recommended that T be immutable and does proper equals testing (e.g., a case class).

    Definition Classes
    ListHelpers
  51. def delta[T, Res](old: Box[Seq[T]], newList: Seq[T])(f: (DeltaInfo[T]) ⇒ Res): List[Res]

    Compute the deltas between two sequences of a given type.

    Compute the deltas between two sequences of a given type. Apply the function based on the differences between the two lists. The resulting List of commands will be returned.

    Definition Classes
    ListHelpers
  52. def doClose[T](is: Closeable*)(f: ⇒ T): T

    Executes by-name function f and then closes the Closeables parameters

    Executes by-name function f and then closes the Closeables parameters

    Definition Classes
    IoHelpers
  53. def emptyForBlank(s: String): Box[String]

    Turn a String into a Box[String], with Empty for the blank string.

    Turn a String into a Box[String], with Empty for the blank string.

    A string containing only spaces is considered blank.

    returns

    Full(s.trim) if s is not null or blank, Empty otherwise

    Definition Classes
    StringHelpers
  54. def encJs(what: String): String

    Encode the string to be including in JavaScript, replacing '\' or '\\' or non-ASCII characters by their unicode value

    Encode the string to be including in JavaScript, replacing '\' or '\\' or non-ASCII characters by their unicode value

    returns

    the encoded string inserted into quotes

    Definition Classes
    StringHelpers
  55. def ensureId(ns: NodeSeq, id: String): NodeSeq

    Ensure that the first Element has the specified ID

    Ensure that the first Element has the specified ID

    Definition Classes
    HtmlHelpers
  56. def ensureUniqueId(in: Seq[NodeSeq]): Seq[NodeSeq]

    For a list of NodeSeq, ensure that the the id of the root Elems are unique.

    For a list of NodeSeq, ensure that the the id of the root Elems are unique. If there's a duplicate, that Elem will be returned without an id

    Definition Classes
    HtmlHelpers
  57. def enumToList[T](enum: Enumeration[T]): List[T]

    Convert a java.util.Enumeration to a List[T]

    Convert a java.util.Enumeration to a List[T]

    Definition Classes
    ListHelpers
  58. def enumToStringList[C](enum: Enumeration[C]): List[String]

    Convert a java.util.Enumeration to a List[String] using the toString method on each element

    Convert a java.util.Enumeration to a List[String] using the toString method on each element

    Definition Classes
    ListHelpers
  59. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  60. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  61. def errorDiv(body: NodeSeq): Box[NodeSeq]
    Definition Classes
    HtmlHelpers
  62. def escChar(in: Char): String

    Create the unicode value of a character

    Create the unicode value of a character

    in

    character

    returns

    the unicode value as a string starting by \\u

    Definition Classes
    StringHelpers
  63. def evalElemWithId(f: (String, Elem) ⇒ NodeSeq)(ns: NodeSeq): NodeSeq

    Within a NodeSeq, find the first elem and run it through the function.

    Within a NodeSeq, find the first elem and run it through the function. Return the resulting NodeSeq

    Definition Classes
    HttpHelpers
  64. def exec(cmds: String*): Box[String]

    Execute the specified OS command and return the output of that command in a Full Box if the command succeeds, or a Failure if an error occurs.

    Execute the specified OS command and return the output of that command in a Full Box if the command succeeds, or a Failure if an error occurs.

    Definition Classes
    IoHelpers
  65. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  66. def findBox[T](nodes: Seq[Node])(f: (Elem) ⇒ Box[T]): Box[T]

    Given a NodeSeq and a function that returns a Box[T], return the first value found in which the function evaluates to Full

    Given a NodeSeq and a function that returns a Box[T], return the first value found in which the function evaluates to Full

    Definition Classes
    HtmlHelpers
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. def findElems(nodes: NodeSeq)(f: (Elem) ⇒ Boolean): NodeSeq

    Find the elements of the specified NodeSeq that match the specified predicate and concatenate them into a resulting NodeSeq.

    Find the elements of the specified NodeSeq that match the specified predicate and concatenate them into a resulting NodeSeq.

    nodes

    - the NodeSeq to search for elements matching the predicate

    f

    - the predicate to match elements with

    returns

    the NodeSeq resulting from concatenation of the matched elements.

    Definition Classes
    HttpHelpers
  73. def findId(ns: NodeSeq): Box[String]

    Finds the first Elem in the NodeSeq (or any children) that has an ID attribute and return the value of that attribute.

    Finds the first Elem in the NodeSeq (or any children) that has an ID attribute and return the value of that attribute.

    Definition Classes
    HtmlHelpers
  74. def findId(nodes: Seq[Node], id: String): Option[Elem]

    Given an id value, find the Elem with the specified id

    Given an id value, find the Elem with the specified id

    Definition Classes
    HtmlHelpers
  75. def findInElems[T](nodes: NodeSeq)(f: (Elem) ⇒ Iterable[T]): List[T]

    Map the specified function over the elements of the specified NodeSeq and return the concatenated result.

    Map the specified function over the elements of the specified NodeSeq and return the concatenated result. This is essentially a container-type-transforming flatMap operation.

    Definition Classes
    HttpHelpers
  76. def findKids(in: NodeSeq, prefix: String, label: String): NodeSeq
    Definition Classes
    HttpHelpers
  77. def findOption[T](nodes: Seq[Node])(f: (Elem) ⇒ Option[T]): Option[T]

    Given a NodeSeq and a function that returns an Option[T], return the first value found in which the function evaluates to Some

    Given a NodeSeq and a function that returns an Option[T], return the first value found in which the function evaluates to Some

    Definition Classes
    HtmlHelpers
  78. def findOrAddId(in: Elem): (Elem, String)

    If the specified Elem has an attribute named 'id', return it, otherwise construct a new Elem with a randomly generated id attribute and return the pair

    If the specified Elem has an attribute named 'id', return it, otherwise construct a new Elem with a randomly generated id attribute and return the pair

    in

    the element to test & add 'id' to

    returns

    the new element and the id

    Definition Classes
    HttpHelpers
  79. 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
  80. 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
  81. 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
  82. def first[B, C](in: Seq[B])(_f: (B) ⇒ Box[C]): Box[C]

    Returns the first application of f to an element of in that results in a Full Box.

    Returns the first application of f to an element of in that results in a Full Box. If f applied to an element of in results in an Empty Box, then f will be applied to the rest of the elements of in until a Full Box results. If the list runs out then an Empty Box is returned.

    in

    a list of elements to which f can be applied

    returns

    a Box containing the first Full Box or Empty if f never returns a Full Box

    Definition Classes
    ListHelpers
  83. def first_?[B](in: Seq[B])(f: ⇒ (B) ⇒ Boolean): Box[B]

    Returns a Full Box with the first element x of the list in for which f(x) evaluates to true.

    Returns a Full Box with the first element x of the list in for which f(x) evaluates to true. If f(x) evaluates to false for every x, then an Empty Box is returned.

    in

    a list of elements to which f can be applied

    f

    a function that can be applied to elements of in

    returns

    a Box containing the found element (or Empty if not found)

    Definition Classes
    ListHelpers
  84. def formattedDateNow: String

    returns

    today's date formatted as yyyy/MM/dd

    Definition Classes
    TimeHelpers
  85. def formattedTimeNow: String

    returns

    now's time formatted as HH:mm zzz

    Definition Classes
    TimeHelpers
  86. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  87. def hash(in: String): String

    create a SHA hash from a String

    create a SHA hash from a String

    Definition Classes
    SecurityHelpers
  88. def hash(in: Array[Byte]): Array[Byte]

    create a SHA hash from a Byte array

    create a SHA hash from a Byte array

    Definition Classes
    SecurityHelpers
  89. def hash256(in: String): String

    create a SHA-256 hash from a String

    create a SHA-256 hash from a String

    Definition Classes
    SecurityHelpers
  90. def hash256(in: Array[Byte]): Array[Byte]

    create a SHA-256 hash from a Byte array

    create a SHA-256 hash from a Byte array

    Definition Classes
    SecurityHelpers
  91. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  92. def hashHex(in: String): String

    create a SHA hash from a String

    create a SHA hash from a String

    Definition Classes
    SecurityHelpers
  93. def head[T](l: Seq[T], deft: ⇒ T): T

    Return the first element of a List or a default value if the list is empty

    Return the first element of a List or a default value if the list is empty

    Definition Classes
    ListHelpers
  94. def hexDecode(str: String): Array[Byte]
    Definition Classes
    SecurityHelpers
  95. def hexDigest(in: Array[Byte]): String

    create a hex encoded SHA hash from a Byte array

    create a hex encoded SHA hash from a Byte array

    Definition Classes
    SecurityHelpers
  96. def hexDigest256(in: Array[Byte]): String

    create a hex encoded SHA-256 hash from a Byte array

    create a hex encoded SHA-256 hash from a Byte array

    Definition Classes
    SecurityHelpers
  97. def hexEncode(in: Array[Byte]): String

    encode a Byte array as hexadecimal characters

    encode a Byte array as hexadecimal characters

    Definition Classes
    SecurityHelpers
  98. def hourFormat(in: Date): String

    returns

    the formatted time for a given Date

    Definition Classes
    TimeHelpers
  99. def hourFormat: SimpleDateFormat

    returns

    a standard format HH:mm:ss

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

    returns

    the number of millis corresponding to 'in' hours

    Definition Classes
    TimeHelpers
  101. 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
  102. def insureField(toInsure: List[(String, String)], headers: List[(String, String)]): List[(String, String)]

    Ensure that all the appropriate fields are in the header.

    Ensure that all the appropriate fields are in the header.

    Definition Classes
    HttpHelpers
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. def isEq(a: Array[Byte], b: Array[Byte]): Boolean

    Compare two arrays of Byte for byte equality.

    Compare two arrays of Byte for byte equality.

    returns

    true if two Byte arrays contain the same bytes

    Definition Classes
    BasicTypesHelpers
  110. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  111. val knownSuffixes: Set[String]

    The list of known suffixes used to split the URI into path parts and suffixes.

    The list of known suffixes used to split the URI into path parts and suffixes.

    Definition Classes
    HttpHelpers
  112. def listFromListAndString(lst: List[String], s: String): List[String]

    Creates a List of Strings from a List[String] and a String

    Creates a List of Strings from a List[String] and a String

    Definition Classes
    StringHelpers
  113. def listFromStrings(s1: String, s2: String): List[String]

    Creates a List of Strings from two Strings

    Creates a List of Strings from two Strings

    Definition Classes
    StringHelpers
  114. def listIf[T](expr: Boolean)(f: ⇒ T): List[T]

    Return a list containing the element f if the expression is true

    Return a list containing the element f if the expression is true

    Definition Classes
    ListHelpers
  115. implicit def listStringToSuper(in: List[String]): SuperListString

    returns

    a SuperString with more available methods such as roboSplit or commafy

    Definition Classes
    StringHelpers
  116. implicit def listToListMapish(in: Seq[(String, String)]): ListMapish

    adds the ciGet method to a List of Pairs of Strings

    adds the ciGet method to a List of Pairs of Strings

    Definition Classes
    ListHelpers
  117. 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
  118. 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
  119. 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
  120. def makeMetaData(key: String, value: String, rest: MetaData): MetaData

    Make a MetaData instance from a key and a value.

    Make a MetaData instance from a key and a value. If key contains a colon, this method will generate a PrefixedAttribute with the text before the colon used as the prefix. Otherwise, it will produce an UnprefixedAttribute.

    Definition Classes
    HtmlHelpers
  121. def md5(in: String): String

    create a MD5 digest from a String

    create a MD5 digest from a String

    Definition Classes
    SecurityHelpers
  122. def md5(in: Array[Byte]): Array[Byte]

    create a MD5 digest from a Byte array

    create a MD5 digest from a Byte array

    Definition Classes
    SecurityHelpers
  123. def millis: Long

    returns

    the current number of millis: System.currentTimeMillis

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

    returns

    the number of days since epoch converted from millis

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

    returns

    the number of millis corresponding to 'in' minutes

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

    returns

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

    Definition Classes
    TimeHelpers
  127. def nano: Long

    returns

    the current System.nanoTime()

    Definition Classes
    TimeHelpers
  128. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  129. def nextFuncName(seed: Long): String

    Get a guaranteed unique field name (16 or 17 letters and numbers, starting with a letter)

    Get a guaranteed unique field name (16 or 17 letters and numbers, starting with a letter)

    Definition Classes
    HttpHelpers
  130. def nextFuncName: String

    Get a guaranteed unique field name (16 or 17 letters and numbers, starting with a letter)

    Get a guaranteed unique field name (16 or 17 letters and numbers, starting with a letter)

    Definition Classes
    HttpHelpers
  131. def nextNum: Long

    Get a monotonically increasing number that's guaranteed to be unique for the current session

    Get a monotonically increasing number that's guaranteed to be unique for the current session

    Definition Classes
    HttpHelpers
  132. def noHtmlTag(in: NodeSeq): Boolean

    Return true if the xml doesn't contain an <html> tag

    Return true if the xml doesn't contain an <html> tag

    Definition Classes
    HttpHelpers
  133. implicit def nodeSeqToOptionString(in: NodeSeq): Box[String]

    returns

    an Empty can if the node seq is empty and a full can with the NodeSeq text otherwise

    Definition Classes
    StringHelpers
  134. def notEq(a: Array[Byte], b: Array[Byte]): Boolean

    Compare two arrays of Byte for byte equality.

    Compare two arrays of Byte for byte equality.

    returns

    true if two Byte arrays don't contain the same bytes

    Definition Classes
    BasicTypesHelpers
  135. final def notify(): Unit
    Definition Classes
    AnyRef
  136. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  137. def now: Date

    returns

    the date object for now

    Definition Classes
    TimeHelpers
  138. def nowAsInternetDate: String

    returns

    the current time as an internet date

    Definition Classes
    TimeHelpers
  139. implicit def pairToUnprefixed(in: (String, Any)): MetaData

    Transform a pair (name: String, value: Any) to an unprefixed XML attribute name="value"

    Transform a pair (name: String, value: Any) to an unprefixed XML attribute name="value"

    Definition Classes
    HttpHelpers
  140. def pairsToMetaData(in: List[String]): MetaData

    Convert a list of strings into a MetaData of attributes.

    Convert a list of strings into a MetaData of attributes.

    The strings in the list must be in the format of key=value.

    Definition Classes
    HtmlHelpers
  141. def paramsToUrlParams(params: List[(String, String)]): String

    Take a list of name/value parse and turn them into a URL query string

    Take a list of name/value parse and turn them into a URL query string

    params

    the name/value pairs

    returns

    a valid query string

    Definition Classes
    HttpHelpers
  142. 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
  143. def parseNumber(tin: String): Long

    Parse a string and return the Long value of that string.

    Parse a string and return the Long value of that string.

    The string can start with '-' if it is a negative number or '+' for a positive number

    returns

    the Long value of the input String

    Definition Classes
    StringHelpers
  144. def permuteList[T](in: Seq[T]): List[List[T]]

    Given a list, return all the permutations of the list.

    Given a list, return all the permutations of the list.

    in

    -- the list

    returns

    all the permutations of the list

    Definition Classes
    ListHelpers
  145. def permuteWithSublists[T](in: Seq[T]): List[List[T]]

    Given a list, return all the permutations including the removal of items (does not return a Nil list unless in is Nil).

    Given a list, return all the permutations including the removal of items (does not return a Nil list unless in is Nil).

    in

    the list to permute

    returns

    all the permutations of the list including sublists, sorted in longest to shortest

    Definition Classes
    ListHelpers
  146. def processString(msg: String, subst: Map[String, String]): String

    Replaces the value found in a string surrounded by <%= ...

    Replaces the value found in a string surrounded by <%= ... %> by a replacement according to the value found in the subst Map.

    Throws an exception if no correspondance can be found.

    msg

    string where replacements should be done

    subst

    map of [regular expression with groups, replacement]

    Definition Classes
    StringHelpers
  147. def randomInt(mod: Int): Int

    return a random int modulo a number

    return a random int modulo a number

    Definition Classes
    SecurityHelpers
  148. def randomLong(mod: Long): Long

    return a random Long modulo a number

    return a random Long modulo a number

    Definition Classes
    SecurityHelpers
  149. def randomString(size: Int): String

    Create a random string of a given size.

    Create a random string of a given size. 5 bits of randomness per character

    size

    size of the string to create. Must be a positive integer.

    returns

    the generated string

    Definition Classes
    StringHelpers
  150. def readWholeFile(path: Path): Array[Byte]

    Read an entire file into an Array[Byte]

    Read an entire file into an Array[Byte]

    Definition Classes
    IoHelpers
  151. def readWholeFile(file: File): Array[Byte]

    Read an entire file into an Array[Byte]

    Read an entire file into an Array[Byte]

    Definition Classes
    IoHelpers
  152. def readWholeStream(in: InputStream): Array[Byte]

    Read all data from a stream into an Array[Byte]

    Read all data from a stream into an Array[Byte]

    Definition Classes
    IoHelpers
  153. def readWholeThing(in: Reader): String

    Read all data to the end of the specified Reader and concatenate the resulting data into a string.

    Read all data to the end of the specified Reader and concatenate the resulting data into a string.

    Definition Classes
    IoHelpers
  154. def removeAttribute(name: String, existingAttributes: MetaData): MetaData

    Remove an attribute from the specified list of existing attributes.

    Remove an attribute from the specified list of existing attributes.

    name

    the name of the attribute to remove

    existingAttributes

    a list of existing attributes

    returns

    the attributes list sans the named attribute

    Definition Classes
    HtmlHelpers
  155. def removeAttribute(name: String, element: Elem): Elem

    Remove an attribute from the specified element.

    Remove an attribute from the specified element.

    name

    the name of the attribute to remove

    returns

    the element sans the named attribute

    Definition Classes
    HtmlHelpers
  156. def roboSplit(what: String, sep: String): List[String]

    Split a string according to a separator

    Split a string according to a separator

    sep

    a regexp to use with the String::split method

    returns

    a list of trimmed parts whose length is > 0

    Definition Classes
    StringHelpers
  157. def rotateList[T](in: Seq[T]): List[List[T]]

    Given an incoming list, return a set of lists that is the original list rotated through all its positions

    Given an incoming list, return a set of lists that is the original list rotated through all its positions

    in

    the list to rotate

    returns

    all the rotations of the list

    Definition Classes
    ListHelpers
  158. def seconds(in: Long): Long

    returns

    the number of millis corresponding to 'in' seconds

    Definition Classes
    TimeHelpers
  159. def secureEquals(s1: Array[Byte], s2: Array[Byte]): Boolean

    Compare two byte arrays in a way that does not vary if the arrays are determined to be not equal early (test every byte...

    Compare two byte arrays in a way that does not vary if the arrays are determined to be not equal early (test every byte... avoids timing attacks

    Definition Classes
    SecurityHelpers
  160. def secureEquals(s1: String, s2: String): Boolean

    Compare two strings in a way that does not vary if the strings are determined to be not equal early (test every byte...

    Compare two strings in a way that does not vary if the strings are determined to be not equal early (test every byte... avoids timing attacks

    Definition Classes
    SecurityHelpers
  161. def secureXML: XMLLoader[Elem]

    Provides a secure XML parser, similar to the one provided by scala.xml.XML, but with external entities and doctypes disabled and secure XML processing enabled.

    Provides a secure XML parser, similar to the one provided by scala.xml.XML, but with external entities and doctypes disabled and secure XML processing enabled. This prevents XXE (XML External Entities) attacks, billion laughs attacks, quadratic blowup attacks, and others. It is used internally throughout Lift, and should be used by anyone who is parsing XML from an untrusted source.

    Definition Classes
    SecurityHelpers
  162. def shouldShow(percent: Double): Boolean

    return true only 'percent' times when asked repeatedly.

    return true only 'percent' times when asked repeatedly. This function is used in the Skittr example to get a random set of users

    percent

    percentage as a double number <= 1.0

    Definition Classes
    SecurityHelpers
  163. def snakify(name: String): String

    Turn a string of format "FooBar" into snake case "foo_bar"

    Turn a string of format "FooBar" into snake case "foo_bar"

    Note: snakify is not reversible, ie. in general the following will _not_ be true:

    s == camelify(snakify(s))

    returns

    the underscored string

    Definition Classes
    StringHelpers
  164. def splitAt(what: String, sep: String): List[(String, String)]

    Split a string in 2 parts at the first place where a separator is found

    Split a string in 2 parts at the first place where a separator is found

    returns

    a List containing a pair of the 2 trimmed parts

    Definition Classes
    StringHelpers
  165. def splitAtHash(str: String)(f: (String) ⇒ String): String

    Split a String at the Hash sign, run the function on the non-# side and then append the hash side

    Split a String at the Hash sign, run the function on the non-# side and then append the hash side

    Definition Classes
    HttpHelpers
  166. def splitColonPair(in: String, first: String, second: String): (String, String)

    Split a string separated by a point or by a column in 2 parts.

    Split a string separated by a point or by a column in 2 parts. Uses default values if only one is found or if no parts are found

    in

    string to split

    first

    default value for the first part if no split can be done

    second

    default value for the second part if one or less parts can be found

    returns

    a pair containing the first and second parts

    Definition Classes
    StringHelpers
  167. def splitNameValuePairs(props: String): Map[String, String]

    Splits a string of the form <name1=value1, name2=value2, ...

    Splits a string of the form <name1=value1, name2=value2, ... > and unquotes the quoted values. The result is a Map[String, String]

    Definition Classes
    StringHelpers
  168. implicit def stringToSuper(in: String): SuperString

    returns

    a SuperString with more available methods such as roboSplit or commafy

    Definition Classes
    StringHelpers
  169. def stripHead(in: NodeSeq): NodeSeq

    Remove all the <head> elements, just leaving their child elements.

    Remove all the <head> elements, just leaving their child elements.

    Definition Classes
    HtmlHelpers
  170. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  171. def time(when: Long): Date

    alias for new Date(millis)

    alias for new Date(millis)

    Definition Classes
    TimeHelpers
  172. def timeFormatter: SimpleDateFormat

    returns

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

    Definition Classes
    TimeHelpers
  173. def toBoolean(in: Any): Boolean

    Convert any object to an "equivalent" Boolean depending on its value

    Convert any object to an "equivalent" Boolean depending on its value

    Definition Classes
    BasicTypesHelpers
  174. def toByteArrayInputStream(in: InputStream): ByteArrayInputStream

    Convert any InputStream to a ByteArrayInputStream

    Convert any InputStream to a ByteArrayInputStream

    Definition Classes
    BasicTypesHelpers
  175. 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
  176. 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
  177. 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
  178. def toHashMap[A, B](in: Map[A, B]): HashMap[A, B]

    Transform a general Map to a nutable HashMap

    Transform a general Map to a nutable HashMap

    Definition Classes
    HttpHelpers
  179. def toInt(in: Any): Int

    Convert any object to an "equivalent" Int depending on its value

    Convert any object to an "equivalent" Int depending on its value

    Definition Classes
    BasicTypesHelpers
  180. def toInternetDate(in: Long): String

    returns

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

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

    returns

    a date formatted with the internet format

    Definition Classes
    TimeHelpers
  182. def toLong(in: Any): Long

    Convert any object to an "equivalent" Long depending on its value

    Convert any object to an "equivalent" Long depending on its value

    Definition Classes
    BasicTypesHelpers
  183. def toString(): String
    Definition Classes
    AnyRef → Any
  184. 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
  185. 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
  186. 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
  187. 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
  188. 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
  189. 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

  190. 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
  191. def unquote(str: String): String

    If str is surrounded by quotes it return the content between the quotes

    If str is surrounded by quotes it return the content between the quotes

    Definition Classes
    StringHelpers
  192. def urlDecode(in: String): String

    URL decode the string.

    URL decode the string.

    This is a pass-through to Java's URL decode with UTF-8

    Definition Classes
    HttpHelpers
  193. def urlEncode(in: String): String

    URL encode the string.

    URL encode the string.

    This is a pass-through to Java's URL encode with UTF-8

    Definition Classes
    HttpHelpers
  194. val utc: TimeZone

    The UTC TimeZone

    The UTC TimeZone

    Definition Classes
    TimeHelpers
  195. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  196. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  197. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  198. def weeks(in: Long): Long

    returns

    the number of millis corresponding to 'in' weeks

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

    returns

    the year corresponding to today (relative to UTC)

    Definition Classes
    TimeHelpers
  200. 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 BasicTypesHelpers

Inherited from IoHelpers

Inherited from HttpHelpers

Inherited from HtmlHelpers

Inherited from CssBindImplicits

Inherited from SecurityHelpers

Inherited from ListHelpers

Inherited from StringHelpers

Inherited from TimeHelpers

Inherited from AnyRef

Inherited from Any

Ungrouped