All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.specs2.reflect.Anyx.scala Maven / Gradle / Ivy

There is a newer version: 3.7
Show newest version
package org.specs2.reflect


/**
 * Utility methods which are useful when the type of the object is not known at compile time
 */
private[specs2] 
trait Anyx { outer =>

  /** @return an ExtendedAny object */
  implicit def extendAny(a: Any): ExtendedAny = new ExtendedAny(a)
  class ExtendedAny(a: Any) {
    def isBoolean = outer.isBoolean(a)
  }

  /** @return true if a is a Boolean object */
  def isBoolean(a: Any) = a match {
    case b: Boolean => true;
    case _ => false
  }
}
private[specs2] 
object Anyx extends Anyx 




© 2015 - 2024 Weber Informatics LLC | Privacy Policy