# Class IntervalConverter

java.lang.Object
com.databricks.jdbc.api.impl.converters.IntervalConverter

public class IntervalConverter extends Object
Converts a java.time.Period or java.time.Duration into the exact ANSI‐style interval literals that Databricks prints.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`IntervalConverter.Field`
The supported fields in the SQL syntax.

## Constructor Summary

Constructors
Constructor
Description
`IntervalConverter(String arrowMetadata)`

## Method Summary

Modifier and Type
Method
Description
`String`
`toLiteral(Object obj)`
Turn a Period (YEAR/MONTH intervals) or Duration (DAY–TIME intervals) into exactly the string Databricks will print.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### IntervalConverter

public IntervalConverter(String arrowMetadata)

Parameters:
  `arrowMetadata` - e.g. "INTERVAL YEAR TO MONTH" or "INTERVAL HOUR TO SECOND"

## Method Details

### toLiteral

public String toLiteral(Object obj)
Turn a Period (YEAR/MONTH intervals) or Duration (DAY–TIME intervals) into exactly the string Databricks will print.