Package org.apache.avro.data
Class TimeConversions.TimestampMicrosConversion
- Enclosing class:
TimeConversions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadjustAndSetValue
(String varName, String valParamName) Certain logical types may require adjusting the code within the "setter" methods to make sure the data that is set is properly formatted.fromLong
(Long microsFromEpoch, Schema schema, LogicalType type) Return the Java class representing the logical type.Return the logical type this class converts.toLong
(Instant instant, Schema schema, LogicalType type) Methods inherited from class org.apache.avro.Conversion
fromArray, fromBoolean, fromBytes, fromCharSequence, fromDouble, fromEnumSymbol, fromFixed, fromFloat, fromInt, fromMap, fromRecord, toArray, toBoolean, toBytes, toCharSequence, toDouble, toEnumSymbol, toFixed, toFloat, toInt, toMap, toRecord
-
Constructor Details
-
TimestampMicrosConversion
public TimestampMicrosConversion()
-
-
Method Details
-
getConvertedType
Description copied from class:Conversion
Return the Java class representing the logical type.- Specified by:
getConvertedType
in classConversion<Instant>
- 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<Instant>
- Returns:
- a String logical type name
-
adjustAndSetValue
Description copied from class:Conversion
Certain logical types may require adjusting the code within the "setter" methods to make sure the data that is set is properly formatted. This method allows the Conversion to generate custom setter code if required.- Overrides:
adjustAndSetValue
in classConversion<Instant>
- Parameters:
varName
- the name of the variable holding the converted valuevalParamName
- the name of the parameter with the new converted value- Returns:
- a String for the body of the setter method
-
fromLong
- Overrides:
fromLong
in classConversion<Instant>
-
toLong
- Overrides:
toLong
in classConversion<Instant>
-
getRecommendedSchema
- Overrides:
getRecommendedSchema
in classConversion<Instant>
-