Class/Object

com.eharmony.aloha.semantics.compiled.plugin.proto

CompiledSemanticsProtoPlugin

Related Docs: object CompiledSemanticsProtoPlugin | package proto

Permalink

case class CompiledSemanticsProtoPlugin[A <: GeneratedMessage](dereferenceAsOptional: Boolean = true)(implicit refInfoA: RefInfo[A]) extends CompiledSemanticsPlugin[A] with MorphableCompiledSemanticsPlugin with EitherHelpers with Product with Serializable

// Idiomatic scala construction.  Implicitly inject manifest.
val scala = ProtoSemantics[UserProto]

// idiomatic java construction.  Construct manifest from Class object.
Semantics<UserProto> java = new ProtoSemantics<UserProto>(UserProto.class);

// Java construction via prototype. Construct manifest from Class object extracted from prototype instance.
Semantics<UserProto> via = new ProtoSemantics<UserProto>(UserProto.getDefaultInstance());

Note, there are a bunch of equivalent ways to construct the semantics. See below:

scala> val lst = Seq(
  |   ProtoSemantics[UserProto],
  |   new ProtoSemantics[UserProto],
  |   ProtoSemantics[UserProto](true),
  |   new ProtoSemantics[UserProto](true),
  |   new ProtoSemantics[UserProto](classOf[UserProto], true),
  |   new ProtoSemantics(classOf[UserProto], true),
  |   new ProtoSemantics(UserProto.getDefaultInstance, true)
  | )
lst: Seq[ProtoSemantics[com.eharmony.matching.common.value.UserProtoBuffs.UserProto]] =
        List(ProtoSemantics(true), ProtoSemantics(true), ProtoSemantics(true), ProtoSemantics(true),
             ProtoSemantics(true), ProtoSemantics(true), ProtoSemantics(true))

scala> lst sameElements Seq.fill(lst.size)(lst.head)
res132: Boolean = true
A

a type of generated protocol buffer message.

dereferenceAsOptional

Whether to treat dereferenced list variables as an Option. If true treat the return value of a dereference operation as an Option. This removes the possibility of a java.lang.IndexOutOfBoundsException being thrown. Instead, it will silently return None. If false, treat the returned value as a required field and don't do any index checking. The default value is true.

Linear Supertypes
Serializable, Serializable, Product, Equals, EitherHelpers, MorphableCompiledSemanticsPlugin, CompiledSemanticsPlugin[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CompiledSemanticsProtoPlugin
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. EitherHelpers
  7. MorphableCompiledSemanticsPlugin
  8. CompiledSemanticsPlugin
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CompiledSemanticsProtoPlugin(prototype: A)

    Permalink

    Construct the semantics, given a prototypical instance of the message type.

    Construct the semantics, given a prototypical instance of the message type.

    prototype

    a prototype instance of the type of message to create. For instance, from Java:

    final Semantics<UserProto> semantics =
      new ProtoSemantics<UserProto>(UserProto.getDefaultInstance());
  2. new CompiledSemanticsProtoPlugin(classValue: Class[A])

    Permalink

    Construct the semantics, given the message's Class object.

    Construct the semantics, given the message's Class object.

    classValue

    A Class object of the protocol buffer generated message. For instance, for Java

    final Semantics<UserProto> semantics =
      new ProtoSemantics<UserProto>(UserProto.class);
  3. new CompiledSemanticsProtoPlugin(prototype: A, dereferenceAsOptional: Boolean)

    Permalink

    Construct the semantics, given a prototypical instance of the message type.

    Construct the semantics, given a prototypical instance of the message type.

    prototype

    a prototype instance of the type of message to create. For instance, from Java:

    final Semantics<UserProto> semantics =
      new ProtoSemantics<UserProto>(UserProto.getDefaultInstance(), false);
    dereferenceAsOptional

    Whether to treat dereferenced list variables as an Option.

  4. new CompiledSemanticsProtoPlugin(classValue: Class[A], dereferenceAsOptional: Boolean)

    Permalink

    Construct the semantics, given the message's Class object.

    Construct the semantics, given the message's Class object.

    classValue

    A Class object of the protocol buffer generated message. For instance, for Java

    final Semantics<UserProto> semantics =
      new ProtoSemantics<UserProto>(UserProto.class, false);
    dereferenceAsOptional

    Whether to treat dereferenced list variables as an Option.

  5. new CompiledSemanticsProtoPlugin(dereferenceAsOptional: Boolean = true)(implicit refInfoA: RefInfo[A])

    Permalink

    dereferenceAsOptional

    Whether to treat dereferenced list variables as an Option. If true treat the return value of a dereference operation as an Option. This removes the possibility of a java.lang.IndexOutOfBoundsException being thrown. Instead, it will silently return None. If false, treat the returned value as a required field and don't do any index checking. The default value is true.

Type Members

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    EitherHelpers

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. def accessorFunctionCode(spec: String): Either[Seq[String], VariableAccessorCode]

    Permalink

    Generate the function body given a spec.

    Generate the function body given a spec.

    spec

    a String specification of the feature for which function code should be generated

    Definition Classes
    CompiledSemanticsProtoPlugin → CompiledSemanticsPlugin
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val dereferenceAsOptional: Boolean

    Permalink

    Whether to treat dereferenced list variables as an Option.

    Whether to treat dereferenced list variables as an Option. If true treat the return value of a dereference operation as an Option. This removes the possibility of a java.lang.IndexOutOfBoundsException being thrown. Instead, it will silently return None. If false, treat the returned value as a required field and don't do any index checking. The default value is true.

  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def fromValidationNel[A](v: ValidationNel[String, A]): ENS[A]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def inputTypeString: String

    Permalink
    Definition Classes
    CompiledSemanticsPlugin
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. def mapSeq[A, B](l: Seq[A])(f: (A) ⇒ ENS[B]): ENS[Seq[B]]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  15. def morph[B](implicit ri: RefInfo[B]): Option[CompiledSemanticsPlugin[B]]

    Permalink
    Definition Classes
    CompiledSemanticsProtoPlugin → MorphableCompiledSemanticsPlugin
  16. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  19. implicit val refInfoA: RefInfo[A]

    Permalink
    Definition Classes
    CompiledSemanticsProtoPlugin → CompiledSemanticsPlugin
  20. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Attributes
    protected[this]
    Definition Classes
    EitherHelpers
  22. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from EitherHelpers

Inherited from MorphableCompiledSemanticsPlugin

Inherited from CompiledSemanticsPlugin[A]

Inherited from AnyRef

Inherited from Any

Ungrouped