Object/Trait

com.eharmony.aloha.reflect

RefInfoOps

Related Docs: trait RefInfoOps | package reflect

Permalink

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
Visibility
  1. Public
  2. All

Type Members

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

    Permalink

    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

    Permalink

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

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

    A

    type to be lifted.

    Definition Classes
    RefInfoOps
  3. trait Lift2[A, B] extends AnyRef

    Permalink

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

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

    A

    first type to be lifted.

    B

    second type to be lifted.

    Definition Classes
    RefInfoOps

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

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

    Permalink
  6. def clone(): AnyRef

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

    Permalink

    Get reflection information about scala.util.Either.

    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
  8. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    RefInfoOpsRefInfoOps
  11. def finalize(): Unit

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

    Permalink

    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( ... )
  13. def fromValidationNel[A](v: ValidationNel[String, A]): ENS[A]

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

    Permalink

    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
  15. final def getClass(): Class[_]

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

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

    Permalink

    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
  18. final def isInstanceOf[T0]: Boolean

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

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

    Permalink

    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()
  21. def mapSeq[A, B](l: Seq[A])(f: (A) ⇒ ENS[B]): ENS[Seq[B]]

    Permalink

    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.

    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

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

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

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

    Permalink

    Get reflection information about Option.

    Get reflection information about Option.

    A

    type of Option

    returns

    reflection information about Option.

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

    Permalink

    Get the RefInfoType instance for type A.

    Get the RefInfoType instance for type A.

    A

    type for which reflection information should be retrieved.

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

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

    Permalink

    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
  29. def toString(): String

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

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

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

    Permalink

    Get reflection information about scalaz.Validation.

    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
  33. def validationNel[A, B](implicit arg0: RefInfo[A], arg1: RefInfo[B]): RefInfo[ValidationNel[A, B]]

    Permalink

    Get reflection information about scalaz.ValidationNel.

    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
  34. final def wait(): Unit

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

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

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

    Permalink

    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
  38. def wrap[A](implicit arg0: RefInfo[A]): Lift1[A]

    Permalink

    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

    Definition Classes
    RefInfoOps

Inherited from EitherHelpers

Inherited from RefInfoOps[RefInfo]

Inherited from AnyRef

Inherited from Any

Ungrouped