kLib by ATVG-Studios

kLib is a generic Kotlin/JVM library that includes a number of little helper Functions, Classes, Interfaces and Objects that allow for a smoother and faster Kotlin development experiance.

Maven Repository

kLib is now available via a two custom Maven repositories. One GPG Signed (Preferred) the other Unsigned.

You can find the Git repository that hosts the Signed Maven data here.
And the Signed Maven Repository itself is available here: https://mvn.atvg-studios.com

The Unsigned Repository can be found here.

Adding the latest stable and signed version of kLib

repositories {
    // Signed Stable Maven Builds
    maven { url 'https://mvn.atvg-studios.com' }
}

dependencies {
    implementation "com.atvgstudios:klib:5.3.0"
}

Adding the latest unstable but signed version of kLib

repositories {
    // Signed Development Maven Builds
    maven { url 'https://mvn.atvg-studios.com/snapshots' }
}

dependencies {
    implementation "com.atvgstudios:klib:6.0.0-dev.2"
}

Adding the latest unsigned versions of kLib

repositories {
    // Unsigned Stable and Development Builds
    maven { url 'https://gitlab.atvg-studios.com/api/v4/projects/123/packages/maven' }

    // New Unsigned Stable and Development Builds
    maven { url 'https://gitlab.atvg-studios.com/api/v4/projects/121/packages/maven' }
}

dependencies {
    // Unsigned Stable
    //implementation "com.atvgstudios:klib:5.3.0"

    // Unsgined Unstable
    //implementation "com.atvgstudios:klib:6.0.0-dev.2"
}

Adding the latest stable and signed version of kLib

repositories {
    // Signed Stable Maven Builds
    maven {
        url = uri("https://mvn.atvg-studios.com")
    }
}

dependencies {
    implementation("com.atvgstudios:klib:5.3.0")
}

Adding the latest unstable but signed version of kLib

repositories {
    // Signed Development Maven Builds
    maven {
        url = uri("https://mvn.atvg-studios.com/snapshots")
    }
}

dependencies {
    implementation("com.atvgstudios:klib:5.3.0")
}

Adding the latest unsigned versions of kLib

repositories {
    // Unsigned Stable and Development Builds
    maven {
        url = uri("https://gitlab.atvg-studios.com/api/v4/projects/123/packages/maven")
    }

    // New Unsigned Stable and Development Builds
    maven {
        url = uri("https://gitlab.atvg-studios.com/api/v4/projects/121/packages/maven")
    }
}

dependencies {
    // Unsigned Stable
    //implementation("com.atvgstudios:klib:5.3.0")

    // Unsigned Unstable
    //implementation("com.atvgstudios:klib:6.0.0-dev.2")
}

Adding the latest version of kLib using Maven:
Please note that we dont officially support Maven!

<repositories>
  <repository>
    <id>atvg-studios</id>
    <name>ATVG-Studios Maven</name>
    <url>https://mvn.atvg-studios.com</url>
  </repository>
<!-- These are only required for development and unsaged builds -->
<!--
  <repository>
    <id>atvg-studios-snapshots</id>
    <name>ATVG-Studios Maven Snapshots</name>
    <url>https://mvn.atvg-studios.com/snapshots</url>
  </repository>
  <repository>
    <id>atvg-studios-automated</id>
    <name>ATVG-Studios Maven Unsigned</name>
    <url>https://gitlab.atvg-studios.com/api/v4/projects/123/packages/maven</url>
  </repository>
  <repository>
    <id>atvg-studios-klib-automated</id>
    <name>ATVG-Studios kLib Unsigned</name>
    <url>https://gitlab.atvg-studios.com/api/v4/projects/121/packages/maven</url>
  </repository>
-->
</repositories>
<dependencies>
  <dependency>
    <groupId>com.atvgstudios</groupId>
    <artifactId>klib</artifactId>
    <version>5.3.0</version>
  </dependency>
</dependencies>

Changelog

This is the changelog since the last major change.
Version 4.0.0 was the last major change that changed a number of package names.

## 5.3.0 - 2021-04-01

### Added
- `times` extension for String
- `TablePrinter` and table DSL to print Text Tables to any PrintStream
- `prompt` global function as Text Prompt with type parsing
- `copyFrom` extension for anything that inherits from Any
- **Added JodaTime as a Dependency** (Adds ~600 KB to FAT jar)
### Changed
- `isNumeric` extension on String uses start and end in regex `^\d+$`

## 5.2.0 - 2021-02-01

### Added
- Link Value to RksvBill
- `alphanumericalRegex` global function
- `replaceAllOf` extension for String
- `normalize' extension for String
- `klib.parser.influx.Influx` object
- `klib.parser.influx.InfluxData` data class
- `toSimpleString` extension for Map
### Changed
- Allow access to Protected and Native methods in LClass
### Deprecated
- AustrianBill, use RksvBill instead

## 5.1.0 - 2020-12-08

### Added
- `string` extension for Random
- Directory as Directory2 alias
- `luhn10` extension for String
- `mod97` extension for String
- isVirtual parameter to ZipFile constructor
- ZipFile.openVirtual to output the file to a random Stream
- `klib.os.Platform` object
- Platform Extensions for System
- `IncompatibleArrayLengthException`
- `onConflict` to Map.`smartMerge` and Map.`mergeArrays`
### Changed
- Upgraded Kotlin from 1.3.71 to 1.4.10
- FFDB v1 files are read-only. (FFDB is still Experimental so this change is acceptable)
- fileName parameter of ZipFile constructor is Nullable (only allowed when isVirtual=true)
- ZipFile.open only opens a file if fileName!=null; throws an error if fileName==null && isVirtual==false
- In ZipFile all file accessors could throw a ZipTraversalNotAllowedException
- Map.`mergeArrays` throws `IncompatibleArrayLengthException` when arrays have different sizes 
### Deprecated
- Queue (`klib.queue.Queue`)
- Function (`klib.queue.Function`)
- Function -> Any (`klib.queue.Function_Any``)
- Word (`klib.word.Word`)
### Fixed
- String.`toUpperCaseOnUnderscore` was rewritten and works propperly now
### Security
- ZipFile reject all paths that seem like they could cause a traversal attack

## 5.0.0 - 2020-06-03 - Release 25

### Added
- JsonKraken 2.0 dependency
- `objectOutputStream` extension for File
- `objectInputStream` extension for File
- FFDB (FlatFile DataBase) (`klib.ffdb.FFDB`)
- IncompatibleDatabaseException (`klib.exceptions.IncompatibleDatabaseException`)
- `openFFDB` extension for String
- `splitBy` extension for String
- `trimSpace` extension for String
### Changed
- Upgraded Kotlin from 1.3.61 to 1.3.71
### Removed
- JsonKraken 1.0 Source
- kSock (`klib.net.socket.kSock`)
- Directory (`klib.files.Directory`)
- `asDirectory` extension for File
- Status number from `klib.files.Directory2.DirectoryError`
### Fixed
- FFDB now checks if the File exists before writing/reading
- FFDB now checks if the FIle is empty before reading

## 4.1.0 - 25.02.2020 - Release 24

### Added
- `Sha512` Object
- `asSha512` extension for ByteArray
- `partition` extension for IntArray
- `swap` extension for IntArray
- `lessThen` extension for Integer
- `lessThenOrEqualTo` extension for Integer
- `greaterThen` extension for Integer
- `greaterThenOrEqualTo` extension for Integer
- `kLibRequireMin` with a minimum only Version (Closes #6)
- `arrayBinSearch` global function
- `listQuicksort` global function
- `replaceLast` extension for String
- Implement [OpenSpec Konfig 19.3](https://gitlab.atvg-studios.com/atvg-studios/openspec/blob/master/Konfig/Konfig.pdf)
- Implement [OpenSpec Konfig 20.1](https://gitlab.atvg-studios.com/atvg-studios/openspec/blob/master/Konfig/Konfig.pdf)
- Implement [OpenSpec Konfig 20.2](https://gitlab.atvg-studios.com/atvg-studios/openspec/blob/master/Konfig/Konfig.pdf)
- `AustrianBill` Class
- Directory2 (`klib.files.Directory2`)

### Changed
- Upgraded Kotlin from 1.3.60 to 1.3.61
- Queue.enqueue `x` parameter renamed to `func`

### Deprecated
- Directory (`klib.files.Directory`)

### Fixed
- `kLibRequire` falsely made a `lessThen` comparison

## 4.0.0 - 23.11.2019

### Added
- KSocket (`klib.net.socket.KSocket`)
- KString (`klib.text.KString`)
- `asFileInputStream` extension for String
- `asFileOutputStream` extension for String
- Light weight JSON Parser (`net.jemzart.jsonkraken`)
- `toListOfType` extension for JsonArray
- `toObjectOfType` extension for JsonObject
- Directory (`klib.files.Directory`)
- `asDirectory` extension for File
- `readAll` extension for FileList
- `writeAll` extensions for FileList
- `replaceAllOf` extension for MutableFileList
- `readInt` global function
- `readLong` global function
- `runRandom` global function
- `orNullable` extension for Any
- `toSnakeCase` extension for String
- `asIntOr` extension for String
- `asLongOr` extensions for String

### Changed
- Upgraded Kotlin from 1.3.31 to 1.3.60
- Moved and Renamed a lot of packages (Major Breaking Change)
- `toObjectFromType` extension on String uses Generics
- `toObjectFromType` extension on String uses Generics

### Deprecated
- kSock (`klib.net.socket.kSock`)

### Removed
- SimpleJSON was removed again (`org.json.*`)
- GSON was removed again (`com.google.gson`)
- `toObject(json, type)` function from Json interface
- `binSearch` extension from MutableList

License

kLib is distributed under the MPL 2.0 License.