Packages

o

ch

Utils

object Utils

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Utils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

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. val LOG_MAX_SIZE: Int
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. lazy val canLog: Boolean
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  8. lazy val crtYear: Int

    returns

    Lastest version for course & study plan information i.e. current year - 1

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def log[T <: Throwable](err: T, additionalMsg: String = ""): Unit

    Writes the stackTrace of the given message to the log file located at res/log/err.log if there were no error getting/creating it.

    Writes the stackTrace of the given message to the log file located at res/log/err.log if there were no error getting/creating it. Otherwise, do nothing.

    err

    Exception to get the stackTrace from

    additionalMsg

    additional Message to add at the top of the stackTrace

  15. def log(msg: String): Unit

    Writes the given message to the log file located at res/log/err.log if there were no error getting/creating it.

    Writes the given message to the log file located at res/log/err.log if there were no error getting/creating it. Otherwise, do nothing.

    msg

    Message to log

  16. lazy val logPath: Path
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  20. def now(): String

    Shorthand for custom datetime format

    Shorthand for custom datetime format

    returns

    Current DateTime timestamp

  21. def pathOf(path: String): Path

    Wraps Path.of(r(path)) see Utils.r for more info

    Wraps Path.of(r(path)) see Utils.r for more info

    path

    resource to locate

    returns

    valid relative to resource (relative w.r.t the runnable i.e. jar or else)

  22. def r(path: String): String

    Resolve given 'against' resource path e.g.

    Resolve given 'against' resource path e.g. if we want to acces /files/res/md/test.md just enter md/test.md. And this function will return the corresponding relative path

    path

    resource to locate

    returns

    valid relative to resource (relative w.r.t the runnable i.e. jar or else)

  23. def read(path: Path): String

    Shorthand for String.join("\n", Files.readAllLines(path, UTF_8)) i.e.

    Shorthand for String.join("\n", Files.readAllLines(path, UTF_8)) i.e. opens, read each line into string, closes, then convert to string

    path

    path to file to read

    returns

    content as string

  24. def readLines(path: Path): IndexedSeq[String]

    Shorthand for Files.readAllLines(path, UTF_8).asScala.toIndexedSeq i.e.

    Shorthand for Files.readAllLines(path, UTF_8).asScala.toIndexedSeq i.e. opens, read each line into list, closes

    path

    path to file to read

    returns

    content as IndexedSeq (immutable)

  25. def sanitize(str: String): String

    Removes special characters and other that can prevent text from displaying / being read/written properly

    Removes special characters and other that can prevent text from displaying / being read/written properly

    str

    sring to sanitize

    returns

    sanitized string

  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. def tryOrElse[T](resolver: () => T, defaultVal: () => T, additionalMsg: String = "", logErr: Boolean = true): T

    Try to apply given function resolver if it succeeds => return the result, or if an exception happened => return defaultVal

    Try to apply given function resolver if it succeeds => return the result, or if an exception happened => return defaultVal

    defaultVal

    function that returns a default value when an exception happened

    additionalMsg

    additional Message to add at the top of the stackTrace

    logErr

    whether to log the error (NB: it's important to pass in a function otherwise the default value will be computed when this method is called)

    returns

    see above

  29. def tryOrElse[T](resolver: () => T, defaultVal: T, additionalMsg: String, logErr: Boolean): T

    Try to apply given function resolver if it succeeds => return the result, or if an exception happened => return defaultVal

    Try to apply given function resolver if it succeeds => return the result, or if an exception happened => return defaultVal

    defaultVal

    value to return when an exception happened

    additionalMsg

    additional Message to add at the top of the stackTrace

    logErr

    whether to log the error

    returns

    see above

  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. def write(path: Path, content: String, append: Boolean = false): Path

    Write string using Files.writeString method (i.e.

    Write string using Files.writeString method (i.e. to write multiple strings do not use this method multiple times)

    path

    Path of file to write to

    content

    content to write to file

    append

    whether to add to previous content or overwrite the file

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped