com.twitter

bijection

package bijection

Bijection trait with numerous implementations.

A Bijection[A, B] is an invertible function from A -> B. Knowing that two types have this relationship can be very helpful for serialization (Bijection[T, Array[Byte]]]), communication between libraries (Bijection[MyTrait, YourTrait]) and many other purposes.

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

Type Members

  1. type @@[T, Tag] = T with Tagged[Tag]

    Tag a type T with Tag.

    Tag a type T with Tag. The resulting type is a subtype of T.

    The resulting type is used to discriminate between type class instances.

  2. abstract class AbstractBijection[A, B] extends Bijection[A, B]

    Abstract class to ease Bijection creation from Java.

  3. abstract class AbstractBufferable[T] extends Bufferable[T]

    For Java and avoiding trait bloat

  4. abstract class AbstractInjection[A, B] extends Injection[A, B]

    Abstract class to ease Bijection creation from Java (and reduce instance size in scala).

  5. case class Base64String(str: String) extends Product with Serializable

  6. trait Bijection[A, B] extends (A) ⇒ B with Serializable

    A Bijection[A, B] is a pair of functions that transform an element between types A and B isomorphically; that is, for all items,

  7. trait BinaryBijections extends StringBijections

    A collection of utilities for encoding strings and byte arrays to and decoding from strings compressed from with gzip.

  8. trait Bufferable[T] extends Serializable

    Bufferable[T] is a typeclass to work with java.

  9. class ClassBijection[T] extends Bijection[Class[T], @@[String, Rep[Class[T]]]]

    Bijection between Class objects and string.

  10. class ClassInjection[T] extends AbstractInjection[Class[T], String]

    Injection between Class objects and string.

  11. trait CollectionBijections extends BinaryBijections

  12. trait CollectionInjections extends StringInjections

  13. trait Conversion[A, B] extends Serializable

  14. sealed class Convert[A] extends Serializable

    Convert allows the user to convert an instance of type A to type B given an implicit Conversion that goes between the two.

  15. trait CrazyLowPriorityConversion extends Serializable

  16. case class EnglishInt(get: String) extends Product with Serializable

  17. case class Forward[A, B](bijection: Bijection[A, B]) extends ImplicitBijection[A, B] with Product with Serializable

  18. case class GZippedBase64String(str: String) extends Product with Serializable

  19. case class GZippedBytes(bytes: Array[Byte]) extends Product with Serializable

  20. trait GeneratedTupleBijections extends LowPriorityBijections

  21. trait GeneratedTupleBufferable extends AnyRef

  22. trait GeneratedTupleCollectionInjections extends LowPriorityInjections

  23. trait GeneratedTupleInjections extends GeneratedTupleCollectionInjections

  24. trait HasRep[A, B] extends AnyRef

    Type class for summoning the function that can check whether the instance can be tagged with Rep

  25. class IdentityBijection[A] extends Bijection[A, A]

  26. sealed trait ImplicitBijection[A, B] extends (A) ⇒ B with Serializable

    Annotations
    @implicitNotFound( ... )
  27. trait Injection[A, B] extends (A) ⇒ B with Serializable

    An Injection[A, B] is a function from A to B, and from some B back to A.

  28. class IntModDivInjection extends Injection[Int, (Int, Int)]

    A common injection on numbers: N -> (m = N mod K, (N-m)/K) The first element in result tuple is always [0, modulus)

  29. class JavaSerializationInjection[T <: Serializable] extends Injection[T, Array[Byte]]

    Use Java serialization to write/read bytes.

  30. class LongModDivInjection extends Injection[Long, (Long, Long)]

    A common injection on numbers: N -> (m = N mod K, (N-m)/K) The first element in result tuple is always [0, modulus)

  31. trait LowPriorityBijections extends AnyRef

  32. trait LowPriorityConversion extends SuperLowPriorityConversion

  33. trait LowPriorityImplicitBijection extends Serializable

  34. trait LowPriorityInjections extends AnyRef

  35. trait NumericBijections extends GeneratedTupleBijections

  36. trait NumericInjections extends GeneratedTupleInjections

  37. trait Pivot[K, K1, K2] extends Bijection[Iterable[K], Map[K1, Iterable[K2]]]

    Pivot is useful in moving from a 1D space of K to a 2D mapping space of K1 x K2.

  38. trait PivotDecoder[K, K1, K2] extends (Map[K1, Iterable[K2]]) ⇒ Iterable[K] with Serializable

  39. trait PivotEncoder[K, K1, K2] extends (Iterable[K]) ⇒ Map[K1, Iterable[K2]] with Serializable

  40. class PivotImpl[K, K1, K2] extends Pivot[K, K1, K2]

  41. trait Rep[A] extends AnyRef

    Type tag used to indicate that an instance of a type such as String contains a valid representation of another type, such as Int or URL.

  42. case class Reverse[A, B](inv: Bijection[B, A]) extends ImplicitBijection[A, B] with Product with Serializable

  43. trait StringBijections extends NumericBijections

  44. trait StringInjections extends NumericInjections

  45. abstract class SubclassBijection[A, B <: A] extends Bijection[A, B]

    When you have conversion between A and B where B is a subclass of A, which is often free, i.

  46. trait SuperLowPriorityConversion extends CrazyLowPriorityConversion

  47. type Tagged[T] = AnyRef { type Tag = T }

    Tagging infrastructure.

Value Members

  1. object Base64String extends Serializable

  2. object Bijection extends CollectionBijections with Serializable

  3. object Bufferable extends GeneratedTupleBufferable with Serializable

  4. object CastInjection

    Injection to cast back and forth between two types.

  5. object ClassBijection extends Serializable

  6. object Conversion extends LowPriorityConversion

  7. object EnglishInt extends Serializable

  8. object ImplicitBijection extends LowPriorityImplicitBijection

  9. object Injection extends CollectionInjections with Serializable

  10. object JavaSerializationInjection extends Serializable

  11. object NumberSystems

  12. object Pivot extends Serializable

  13. object Rep

    Useful HasRep

  14. object StringCodec extends StringInjections

  15. object StringJoinBijection

    Bijection for joining together iterables of strings into a single string and splitting them back out.

  16. object SwapBijection

    Bijection that flips the order of items in a Tuple2.

Inherited from AnyRef

Inherited from Any

Ungrouped