Package org.apache.avro.data
Class TimeConversions.TimeMicrosConversion
- 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 microsFromMidnight, Schema schema, LogicalType type) Return the Java class representing the logical type.Return the logical type this class converts.toLong
(LocalTime time, 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
-
TimeMicrosConversion
public TimeMicrosConversion()
-
-
Method Details
-
getConvertedType
Description copied from class:Conversion
Return the Java class representing the logical type.- Specified by:
getConvertedType
in classConversion<LocalTime>
- 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<LocalTime>
- 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<LocalTime>
- 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<LocalTime>
-
toLong
- Overrides:
toLong
in classConversion<LocalTime>
-
getRecommendedSchema
- Overrides:
getRecommendedSchema
in classConversion<LocalTime>
-