# DateIntervalInfo.PatternInfo

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# PatternInfo

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/icu/text/DateIntervalInfo.PatternInfo "View this page in Java")  

```
class PatternInfo : Cloneable, Serializable
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                 ||
| ↳ | [android.icu.text.DateIntervalInfo.PatternInfo](https://developer.android.com/reference/kotlin/android/icu/text/DateIntervalInfo.PatternInfo#) |

PatternInfo class saves the first and second part of interval pattern, and whether the interval pattern is earlier date first.

## Summary

|                                                                                                                                                                                                                                                           Public constructors                                                                                                                                                                                                                                                           ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [PatternInfo](https://developer.android.com/reference/kotlin/android/icu/text/DateIntervalInfo.PatternInfo#PatternInfo(kotlin.String,%20kotlin.String,%20kotlin.Boolean))`(`firstPart:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `secondPart:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `firstDateInPtnIsLaterDate:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Constructs a`PatternInfo`object. |

|                                                                                                                                                                              Public methods                                                                                                                                                                               ||
|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/android/icu/text/DateIntervalInfo.PatternInfo#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Compares the specified object with this`PatternInfo`for equality. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [firstDateInPtnIsLaterDate](https://developer.android.com/reference/kotlin/android/icu/text/DateIntervalInfo.PatternInfo#firstDateInPtnIsLaterDate())`()` Returns whether the first date in interval patter is later date or not.                                                     |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!  | [getFirstPart](https://developer.android.com/reference/kotlin/android/icu/text/DateIntervalInfo.PatternInfo#getFirstPart())`()` Returns the first part of interval pattern.                                                                                                           |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!  | [getSecondPart](https://developer.android.com/reference/kotlin/android/icu/text/DateIntervalInfo.PatternInfo#getSecondPart())`()` Returns the second part of interval pattern.                                                                                                        |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [hashCode](https://developer.android.com/reference/kotlin/android/icu/text/DateIntervalInfo.PatternInfo#hashCode())`()` Returns the hash code of this`PatternInfo`.                                                                                                                   |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)   | [toString](https://developer.android.com/reference/kotlin/android/icu/text/DateIntervalInfo.PatternInfo#toString())`()` Returns a string representation of the object.                                                                                                                |

## Public constructors

### PatternInfo

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
PatternInfo(
    firstPart: String!, 
    secondPart: String!, 
    firstDateInPtnIsLaterDate: Boolean)
```

Constructs a`PatternInfo`object.

|                                                                                   Parameters                                                                                    ||
|-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| `firstPart`                 | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The first part of interval pattern.                              |
| `secondPart`                | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The second part of interval pattern.                             |
| `firstDateInPtnIsLaterDate` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html):Whether the first date in interval patter is later date or not. |

## Public methods

### equals

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun equals(other: Any?): Boolean
```

Compares the specified object with this`PatternInfo`for equality.

|                     Parameters                     ||
|-------|---------------------------------------------|
| `obj` | the reference object with which to compare. |
| `a`   | The object to be compared.                  |

|                                                                      Return                                                                      ||
|------------------------------------------------------------------------------------|--------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if the specified object is equal to this`PatternInfo`. |

### firstDateInPtnIsLaterDate

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun firstDateInPtnIsLaterDate(): Boolean
```

Returns whether the first date in interval patter is later date or not.

|                                                                       Return                                                                        ||
|------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | Whether the first date in interval patter is later date or not. |

### getFirstPart

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getFirstPart(): String!
```

Returns the first part of interval pattern.

|                                                         Return                                                         ||
|-----------------------------------------------------------------------------------|-------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The first part of interval pattern. |

### getSecondPart

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getSecondPart(): String!
```

Returns the second part of interval pattern.

|                                                         Return                                                          ||
|-----------------------------------------------------------------------------------|--------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The second part of interval pattern. |

### hashCode

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hashCode(): Int
```

Returns the hash code of this`PatternInfo`.

|                                                     Return                                                     ||
|----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | A hash code value for this object. |

### toString

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun toString(): String
```

Returns a string representation of the object.

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |