Package org.apache.avro.protobuf
Class ProtoConversions.TimestampNanosConversion
java.lang.Object
org.apache.avro.Conversion<com.google.protobuf.Timestamp>
org.apache.avro.protobuf.ProtoConversions.TimestampNanosConversion
- Enclosing class:
ProtoConversions
public static class ProtoConversions.TimestampNanosConversion
extends Conversion<com.google.protobuf.Timestamp>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.protobuf.Timestamp
fromLong
(Long nanosFromEpoch, Schema schema, LogicalType type) Class
<com.google.protobuf.Timestamp> Return the Java class representing the logical type.Return the logical type this class converts.toLong
(com.google.protobuf.Timestamp value, Schema schema, LogicalType type) Methods inherited from class org.apache.avro.Conversion
adjustAndSetValue, fromArray, fromBoolean, fromBytes, fromCharSequence, fromDouble, fromEnumSymbol, fromFixed, fromFloat, fromInt, fromMap, fromRecord, toArray, toBoolean, toBytes, toCharSequence, toDouble, toEnumSymbol, toFixed, toFloat, toInt, toMap, toRecord
-
Constructor Details
-
TimestampNanosConversion
public TimestampNanosConversion()
-
-
Method Details
-
getConvertedType
Description copied from class:Conversion
Return the Java class representing the logical type.- Specified by:
getConvertedType
in classConversion<com.google.protobuf.Timestamp>
- Returns:
- a Java class returned by from methods and accepted by to methods
-
getLogicalTypeName
Description copied from class:Conversion
Return the logical type this class converts.- Specified by:
getLogicalTypeName
in classConversion<com.google.protobuf.Timestamp>
- Returns:
- a String logical type name
-
fromLong
public com.google.protobuf.Timestamp fromLong(Long nanosFromEpoch, Schema schema, LogicalType type) throws IllegalArgumentException - Overrides:
fromLong
in classConversion<com.google.protobuf.Timestamp>
- Throws:
IllegalArgumentException
-
toLong
- Overrides:
toLong
in classConversion<com.google.protobuf.Timestamp>
-
getRecommendedSchema
- Overrides:
getRecommendedSchema
in classConversion<com.google.protobuf.Timestamp>
-