Package

com.eharmony.aloha.semantics.compiled.plugin

csv

Permalink

package csv

Visibility
  1. Public
  2. All

Type Members

  1. case class CompiledSemanticsCsvPlugin(colNamesToTypes: Map[String, CsvType] = Map.empty) extends CompiledSemanticsPlugin[CsvLine] with Product with Serializable

    Permalink

    Create a plugin that can generate code for TSV lines.

    Create a plugin that can generate code for TSV lines.

    colNamesToTypes

    a mapping from field name to field type.

  2. trait CsvLine extends AnyRef

    Permalink
  3. case class CsvLineImpl(line: String, indices: Map[String, Int], enums: Map[String, Enum], fieldSeparator: String, intraFieldSeparator: String, missingId: (String) ⇒ Boolean, optEnumFunc: (String) ⇒ Option[(String) ⇒ EnumConstant], optHandler: OptionalHandler) extends CsvLine with Product with Serializable

    Permalink

    A representation of one line of CSV data.

    A representation of one line of CSV data.

    line

    The actual string line representing the data.

    indices

    A mapping from column name to column index

    enums

    A mapping from column name to enumerated type. This allows java-like enum syntax to be used

    fieldSeparator

    the between-column separator

    intraFieldSeparator

    separator within a column that allows vector-based input for given columns

    missingId

    a function that determines if the data in a given field or in a given position in a vector-based field is missing.

    optEnumFunc

    a function that given a field name optionally produces a function from field value to an enumerated type.

    optHandler

    an object responsible for the failure policy when an optional field or a field of vector of optional is provided with bad data.

  4. case class CsvLines(indices: Map[String, Int], enums: Map[String, Enum] = Map.empty, fs: String = "\t", ifs: String = ",", missingData: (String) ⇒ Boolean = EmptyStringIsMissing, errorOnOptMissingField: Boolean = false, errorOnOptMissingEnum: Boolean = false) extends Product with Serializable

    Permalink

    A class capable of efficiently creating CsvLine objects.

    A class capable of efficiently creating CsvLine objects.

    indices

    a mapping from field name to field index (0-based)

    enums

    a mapping from field name to emulated Enum type.

    fs

    field separator (between fields)

    ifs

    intra-field separator (within fields, for use in sequence data)

    missingData

    a function that determines if the data in an optional field is considered missing

    errorOnOptMissingField

    should an error occur when an optional field is request for a non-existent column name.

    errorOnOptMissingEnum

    should an error occur when an optional enum field is request for a column not associated with any enum.

  5. trait CsvProtocol extends AnyRef

    Permalink
  6. case class Enum(className: String, constantsAndNumbers: (String, Int)*) extends Dynamic with Product with Serializable

    Permalink

    This class is designed to emulate Java enum values created by Google's Protocol Buffer library.

    This class is designed to emulate Java enum values created by Google's Protocol Buffer library.

    val GenderProto = Enum("com.eharmony.matching.common.value.ProfileProtoBuffs.ProfileProto.GenderProto", "MALE" -> 1, "FEMALE" -> 2)
    assert(1 == GenderProto.valueOf("MALE").getNumber)
    assert(0 == GenderProto.valueOf("MALE").ordinal)
    
    try { GenderProto.valueOf("HERMAPHRODITE");  throw new Exception("fail") }
    catch { case e: IllegalArgumentException => assert(e.getMessage == s"No enum const class ${GenderProto.className}.HERMAPHRODITE") }
    className

    The canonical class name of the enum being emulated

    constantsAndNumbers

    the enum constant names and their number (returned by get number).

  7. sealed trait EnumConstant extends AnyRef

    Permalink

    A representation of an emulated enum constant.

  8. case class EnumConstantImpl(name: String, ordinal: Int, getNumber: Int) extends EnumConstant with Product with Serializable

    Permalink

    An emulated enum constant.

    An emulated enum constant.

    name

    Name of the enum constant.

    ordinal

    the ordinal value of the enum constant (this is the order in which the constant appears in the list of constants)

    getNumber

    a number (added to allow emulated of protocol buffer generated enums)

  9. case class FailFastOptionalHandler(indices: Map[String, Int]) extends OptionalHandler with Product with Serializable

    Permalink
  10. case class GracefulOptionalHandler(indices: Map[String, Int]) extends OptionalHandler with Product with Serializable

    Permalink
  11. sealed trait OptionalHandler extends AnyRef

    Permalink
  12. case class RepeatedIndexedSeq[+A](length: Int, a: A) extends IndexedSeq[A] with Product with Serializable

    Permalink

Value Members

  1. object CompiledSemanticsCsvPlugin extends Serializable

    Permalink
  2. object CsvLines extends Serializable

    Permalink
  3. object CsvProtocol extends CsvProtocol

    Permalink
  4. object CsvTypes extends Enumeration

    Permalink

    The string values here match the function names in CsvLine.

    The string values here match the function names in CsvLine. This is important that the name passed to each instance of Val is exactly the same as the corresponding function name in com.eharmony.aloha.semantics.compiled.plugin.csv.CsvLine.

  5. object Enum extends Serializable

    Permalink
  6. object EnumConstant

    Permalink
  7. object RepeatedIndexedSeq extends Serializable

    Permalink

Ungrouped