<commit_before># ext4klaxon
Type Extensions for [Klaxon](https://github.com/cbeust/klaxon) (Kotlin JSON library)

## Current extensions:
* Long
* Int
* Enum

### Long
Get Long, Double, Float, String as Int, without loosing precision when it is convertable
```kotlin
val i = jsonObject.intStrict("fieldName")
```

### Int
Get Int, Double, Float or String as Long, when it is convertable
```kotlin
val l = jsonObject.intStrict("fieldName")
```

### Enum
Convert any string to enum:
```kotlin
val e = jsonObject.enum<EnumType>("fieldName")
```

```kotlin
val e = jsonObject.enumFromValues("fieldName", Enum.values())
```

### Enum
Get any whole Numeric as Date
```kotlin
val e = jsonObject.date("fieldName")
```



## Download

**ext4klaxon is under development.**

Gradle:
```groovy
compile 'com.fboldog.ext4klaxon:ext4klaxon:0.2.0'
```

or Maven:
```xml
<dependency>
  <groupId>com.fboldog.ext4klaxon</groupId>
  <artifactId>ext4klaxon</artifactId>
  <version>0.2.0</version>
</dependency>
```<commit_msg>ooops, it is Date ;)<commit_after># ext4klaxon
Type Extensions for [Klaxon](https://github.com/cbeust/klaxon) (Kotlin JSON library)

## Current extensions:
* Long
* Int
* Enum

### Long
Get Long, Double, Float, String as Int, without loosing precision when it is convertable
```kotlin
val i = jsonObject.intStrict("fieldName")
```

### Int
Get Int, Double, Float or String as Long, when it is convertable
```kotlin
val l = jsonObject.intStrict("fieldName")
```

### Enum
Convert any string to enum:
```kotlin
val e = jsonObject.enum<EnumType>("fieldName")
```

```kotlin
val e = jsonObject.enumFromValues("fieldName", Enum.values())
```

### Date
Get any whole Numeric as Date
```kotlin
val e = jsonObject.date("fieldName")
```



## Download

**ext4klaxon is under development.**

Gradle:
```groovy
compile 'com.fboldog.ext4klaxon:ext4klaxon:0.2.0'
```

or Maven:
```xml
<dependency>
  <groupId>com.fboldog.ext4klaxon</groupId>
  <artifactId>ext4klaxon</artifactId>
  <version>0.2.0</version>
</dependency>
```
{'fraction_non_alphanumeric': 0.16129032258064516, 'fraction_numerical': 0.011910669975186104, 'mean_word_length': 5.4, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5115843', 'n_tokens_mistral': 772, 'n_tokens_neox': 694, 'n_words': 190}