# Class TrinoIntervalYearMonth

java.lang.Object
io.trino.jdbc.TrinoIntervalYearMonth

All Implemented Interfaces:
  `Comparable<TrinoIntervalYearMonth>`

public class TrinoIntervalYearMonth extends Object implements Comparable<TrinoIntervalYearMonth>

## Constructor Summary

Constructors
Constructor
Description
`TrinoIntervalYearMonth(int months)`
`TrinoIntervalYearMonth(int year, int months)`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(TrinoIntervalYearMonth o)`
`boolean`
`equals(Object obj)`
`int`
`getMonths()`
`int`
`hashCode()`
`String`
`toString()`

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

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### TrinoIntervalYearMonth

public TrinoIntervalYearMonth(int months)

### TrinoIntervalYearMonth

public TrinoIntervalYearMonth(int year, int months)

## Method Details

### getMonths

public int getMonths()

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### compareTo

public int compareTo(TrinoIntervalYearMonth o)

Specified by:
  `compareTo` in interface `Comparable<TrinoIntervalYearMonth>`

### toString

public String toString()

Overrides:
  `toString` in class `Object`