implicit class GenericRecordOps extends AnyRef
Add some functionalities to facilitate extracting values from an Avro message
- Alphabetic
- By Inheritance
- GenericRecordOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new GenericRecordOps(record: GenericRecord)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
as[T](fieldName: String)(f: (AnyRef, Schema) ⇒ Either[SAvroError, Option[T]]): Either[SAvroError, Option[T]]
Tries to extract the value of the field name from the Avro message.
Tries to extract the value of the field name from the Avro message.
The provided function accepts a value (a JVM object) with the schema of the field should return an optional value. The function doesn't need to be concern about the null values because
aswill return aNoneif the value of the field isnulland won't call the function. -
def
asBoolean(fieldName: String): Either[SAvroError, Option[Boolean]]
Returns the value of
fieldNameas boolean if exists -
def
asDouble(fieldName: String): Either[SAvroError, Option[Double]]
Returns the value of
fieldNameas double if exists -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
asInt(fieldName: String): Either[SAvroError, Option[Int]]
Returns the value of
fieldNameas integer if exists -
def
asLong(fieldName: String): Either[SAvroError, Option[Long]]
Returns the value of
fieldNameas long if exists -
def
asString(fieldName: String): Option[String]
Returns the value of
fieldNameas string if exists -
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
set[T](fieldName: String, value: T): GenericRecord
A wrapper for
GenericRecord#putthat supports null values.A wrapper for
GenericRecord#putthat supports null values. Set the value of a field with an optional value. It putsnullif the value is empty. -
def
set[T](fieldName: String, value: Option[T]): GenericRecord
A wrapper for
GenericRecord#putthat supports null values.A wrapper for
GenericRecord#putthat supports null values. Set the value of a field with an optional value. It putsnullif the value is empty. Note that due to GenericRecord limitation, the record is not immutable. The return value is the same record and not a new on. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()