com.eharmony.aloha.reflect

RefInfoOps

object RefInfoOps extends RefInfoOps[RefInfo] with EitherHelpers

Concrete implementations for retrieving and manipulating reflection meta information. All reflection in the library should use this facade and should not use Manifests or TypeTags.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RefInfoOps
  2. EitherHelpers
  3. RefInfoOps
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type ENS[+A] = Either[Seq[String], A]

    Either of Non-empty Seq (Like poor man's version of ValidationNel from scalaz)

    Either of Non-empty Seq (Like poor man's version of ValidationNel from scalaz)

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  2. trait Lift1[A] extends AnyRef

    Provides a generic way of lifting A into a container for which a RefInfoType instance can be retrieved.

  3. trait Lift2[A, B] extends AnyRef

    Provides a generic way of lifting A and B into a container for which a RefInfoType instance can be retrieved.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def classRegex[A](implicit a: RefInfo[A]): Regex

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def either[A, B](implicit arg0: RefInfo[A], arg1: RefInfo[B]): RefInfo[Either[A, B]]

    Get reflection information about scala.

    Get reflection information about scala.util.Either.

    A

    left type parameter of Either

    B

    right type parameter of Either

    returns

    reflection information about scala.util.Either

    Definition Classes
    RefInfoOpsRefInfoOps
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def execStaticNoArgFunc[A](name: String)(implicit arg0: RefInfo[A]): Either[Seq[String], AnyRef]

    Definition Classes
    RefInfoOpsRefInfoOps
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def fromSimpleClass[A](clazz: Class[_ <: A]): RefInfo[A]

    Get reflection info from a simple Class.

    Get reflection info from a simple Class. Will throw an exception if we find that the type is parametrized.

    A

    the type of the RefInfoType to create

    clazz

    a Class object

    returns

    reflection information about simple type represented by clazz.

    Definition Classes
    RefInfoOpsRefInfoOps
    Annotations
    @throws( ... )
  15. def fromValidationNel[A](v: ValidationNel[String, A]): ENS[A]

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  16. def genAggFunc[A, B](implicit arg0: RefInfo[A], arg1: RefInfo[B]): RefInfo[GenAggFunc[A, B]]

    Get reflection information about com.eharmony.aloha.semantics.func.GenAggFunc

    Get reflection information about com.eharmony.aloha.semantics.func.GenAggFunc

    A

    function input type

    B

    function output type

    returns

    reflection information about com.eharmony.aloha.semantics.func.GenAggFunc

    Definition Classes
    RefInfoOpsRefInfoOps
  17. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  19. def isImmutableIterableButNotMap[A, Iter](implicit a: RefInfo[A], possibleIterable: RefInfo[Iter]): Boolean

    Attempt to determine if possibleIterable is a scala.collection.immutable.Iterable[A] but not a scala.collection.Map.

    Attempt to determine if possibleIterable is a scala.collection.immutable.Iterable[A] but not a scala.collection.Map.

    This is kind of a stopgap solution because the subtype operator <:< doesn't really work well for Manifests. This is an issue because currently, Aloha uses Manifests rather than TypeTags for type checking. Comments in ClassManifestDeprecatedApis says:

    "this part is wrong for punting unless the rhs has no type arguments, but it's better than a blindfolded pinata swing."

    This implementation covers many simple cases in the intersection of scala 2.10 and 2.11 instances. See test for coverage.

    A

    element type

    Iter

    possible iterable type.

    a

    RefInfo instance of element type

    possibleIterable

    a possible Iterable

    returns

    true if possibleIterable is a scala.collection.immutable.Iterable[A] but not a scala.collection.Map[_, _].

    Definition Classes
    RefInfoOpsRefInfoOps
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. def isJavaInterface[A](implicit a: RefInfo[A]): Boolean

  22. def isSubType[Sub, Super](implicit sub: RefInfo[Sub], sup: RefInfo[Super]): Boolean

    Is Sub a subtype of Super

    Is Sub a subtype of Super

    Sub

    subtype in test

    Super

    supertype in test

    sub

    RefInfo instance of type A

    sup

    RefInfo instance of type A

    Definition Classes
    RefInfoOpsRefInfoOps
    Annotations
    @SuppressWarnings()
  23. def mapSeq[A, B](l: Seq[A])(f: (A) ⇒ ENS[B]): ENS[Seq[B]]

    Like l.

    Like l.map(f).sequence[({type L[+A] = Either[Seq[String], A]})#L, C ] in scalaz except that it short circuits if it finds an error. (There must be some better way to do this w/ scalaz).

    If we put a println("folding") at the top of the inner function h, we would get the following:

    scala> mapSeq(Left(Seq("1")) +: (2 to 3).map(Right(_)))(identity)  // Only 1 "folding" instead of 3.
    folding
    res0: ENS[Seq[Int]] = Left(List(0))
    
    scala> mapSeq((1 to 3).map(Right(_)))(identity)
    folding
    folding
    folding
    res1: ENS[Seq[Int]] = Right(List(1, 2, 3))
    A

    type of values in the input sequence in the first parameter list.

    B

    type of values in the output sequence if successful.

    l

    list of values to which f should be applied.

    f

    function to map over l

    returns

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  24. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. def option[A](implicit arg0: RefInfo[A]): RefInfo[Option[A]]

    Get reflection information about Option.

    Get reflection information about Option.

    A

    type of Option

    returns

    reflection information about Option.

    Definition Classes
    RefInfoOpsRefInfoOps
  28. def refInfo[A](implicit arg0: RefInfo[A]): RefInfo[A]

    Get the RefInfoType instance for type A.

    Get the RefInfoType instance for type A.

    A

    type for which reflection information should be retrieved.

    returns

    Definition Classes
    RefInfoOps
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def toString[A](implicit arg0: RefInfo[A]): String

    Get a string representation of the RefInfoType.

    Get a string representation of the RefInfoType. This should be adequate to full characterize the type and any type parameters (i.e., should contain the erased type information)

    A

    type of the reflected object whose string-based representation the function is retrieving.

    returns

    string-based representation of A

    Definition Classes
    RefInfoOpsRefInfoOps
  31. def toString(): String

    Definition Classes
    AnyRef → Any
  32. def toValidationNel[A](e: ENS[A]): ValidationNel[String, A]

    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  33. def typeParams[A](implicit a: RefInfo[A]): List[RefInfo[_]]

    Definition Classes
    RefInfoOpsRefInfoOps
  34. def validation[A, B](implicit arg0: RefInfo[A], arg1: RefInfo[B]): RefInfo[Validation[A, B]]

    Get reflection information about scalaz.

    Get reflection information about scalaz.Validation.

    A

    left type parameter of Validation

    B

    right type parameter of Validation

    returns

    reflection information about scalaz.Validation

    Definition Classes
    RefInfoOpsRefInfoOps
  35. def validationNel[A, B](implicit arg0: RefInfo[A], arg1: RefInfo[B]): RefInfo[ValidationNel[A, B]]

    Get reflection information about scalaz.

    Get reflection information about scalaz.ValidationNel.

    A

    left type parameter of ValidationNel

    B

    right type parameter of ValidationNel

    returns

    reflection information about scalaz.ValidationNel

    Definition Classes
    RefInfoOpsRefInfoOps
  36. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. def wrap[A, B](implicit arg0: RefInfo[A], arg1: RefInfo[B]): Lift2[A, B]

    Provides a generic mechanism to wrap the types A and B inside a container taking two parameters.

    Provides a generic mechanism to wrap the types A and B inside a container taking two parameters.

    val w = RefInfoOps.wrap[String, Double]
    // pass around w to some other object ...
    val e: RefInfo[Either[String, Double]] = w.in[Either]
    
    import scalaz.Validation
    val v1 = RefInfoOps.wrap[String, Double].in[Validation]
    val v2 = RefInfoOps.validation[String, Double]
    assert(v1 == v2)
    A

    first type being lifted.

    B

    second type being lifted.

    returns

    a Lift2 instance containing information about A and B that can be used to later construct a RefInfoType from a kind passed to the in function.

    Definition Classes
    RefInfoOps
  40. def wrap[A](implicit arg0: RefInfo[A]): Lift1[A]

    Get a Lift1 instance to wrap type A in a RefInfoType.

    Get a Lift1 instance to wrap type A in a RefInfoType.

    val w = RefInfoOps.wrap[String]
    val o1 = w.in[Option]
    val o2 = RefInfoOps.option[String]
    assert(o1 == o2)
    A

    type being lifted

    returns

    Definition Classes
    RefInfoOps

Inherited from EitherHelpers

Inherited from RefInfoOps[RefInfo]

Inherited from AnyRef

Inherited from Any

Ungrouped