Skip to content

Commit

Permalink
chore: merge branch 'release/1.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ghasemdev committed Aug 23, 2022
2 parents 690ea2c + a0601a7 commit de00e6b
Show file tree
Hide file tree
Showing 361 changed files with 14,670 additions and 2,788 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [🐛 v1.5.1 ] - 2022-08-15
## [🐛 v1.5.1 ] - 2022-08-23

### 🐛 Fixes

* Fix min sdk issue
### Fix min sdk issue and some improvements

## [🎉 1.5.0 Structure, Logger, OkHttp] - 2022-08-22

Expand Down
4 changes: 2 additions & 2 deletions affogato-core-ktx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ dependencies {
afterEvaluate {
publishing {
publications {
create<MavenPublication>("java") {
create<MavenPublication>("release") {
groupId = "com.parsuomash.affogato"
artifactId = "affogato-core-ktx"
version = "1.5.0"
version = "1.5.1"

from(components["java"])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ package com.parsuomash.affogato.core.ktx
* @since 1.1.0
* @return [Number] value or **Zero**
*/
fun Number?.orZero(): Number = this ?: 0
@JvmSynthetic
fun Number?.orZero(): Number =
this ?: 0
Original file line number Diff line number Diff line change
@@ -1,5 +1,61 @@
package com.parsuomash.affogato.core.ktx

/**
* Checking positivity.
*
* Example:
* ```Kotlin
* 10.isPositive() // true
* -10.isPositive() // false
* ```
* @since 1.5.1
*/
@get:JvmSynthetic
inline val Int.isPositive: Boolean
get() = this > 0

/**
* Checking positivity.
*
* Example:
* ```Kotlin
* 10L.isPositive() // true
* -10L.isPositive() // false
* ```
* @since 1.5.1
*/
@get:JvmSynthetic
inline val Long.isPositive: Boolean
get() = this > 0

/**
* Checking positivity.
*
* Example:
* ```Kotlin
* 10F.isPositive() // true
* -10F.isPositive() // false
* ```
* @since 1.5.1
*/
@get:JvmSynthetic
inline val Float.isPositive: Boolean
get() = this > 0

/**
* Checking positivity.
*
* Example:
* ```Kotlin
* 10.0.isPositive() // true
* -10.0.isPositive() // false
* ```
* @since 1.5.1
*/
@get:JvmSynthetic
inline val Double.isPositive: Boolean
get() = this > 0

/**
* Checking negativity.
*
Expand All @@ -10,7 +66,9 @@ package com.parsuomash.affogato.core.ktx
* ```
* @since 1.1.0
*/
inline val Int.isNegative: Boolean get() = this < 0
@get:JvmSynthetic
inline val Int.isNegative: Boolean
get() = this < 0

/**
* Checking negativity.
Expand All @@ -22,7 +80,9 @@ inline val Int.isNegative: Boolean get() = this < 0
* ```
* @since 1.1.0
*/
inline val Long.isNegative: Boolean get() = this < 0
@get:JvmSynthetic
inline val Long.isNegative: Boolean
get() = this < 0

/**
* Checking negativity.
Expand All @@ -34,7 +94,9 @@ inline val Long.isNegative: Boolean get() = this < 0
* ```
* @since 1.1.0
*/
inline val Float.isNegative: Boolean get() = this < 0
@get:JvmSynthetic
inline val Float.isNegative: Boolean
get() = this < 0

/**
* Checking negativity.
Expand All @@ -46,7 +108,9 @@ inline val Float.isNegative: Boolean get() = this < 0
* ```
* @since 1.1.0
*/
inline val Double.isNegative: Boolean get() = this < 0
@get:JvmSynthetic
inline val Double.isNegative: Boolean
get() = this < 0

/**
* Return zero when number is null.
Expand All @@ -59,7 +123,9 @@ inline val Double.isNegative: Boolean get() = this < 0
* @since 1.1.0
* @return [Int] value or **Zero**
*/
fun Int?.orZero(): Int = this ?: 0
@JvmSynthetic
fun Int?.orZero(): Int =
this ?: 0

/**
* Return zero when number is null.
Expand All @@ -72,7 +138,9 @@ fun Int?.orZero(): Int = this ?: 0
* @since 1.1.0
* @return [Long] value or **Zero**
*/
fun Long?.orZero(): Long = this ?: 0L
@JvmSynthetic
fun Long?.orZero(): Long =
this ?: 0L

/**
* Return zero when number is null.
Expand All @@ -85,7 +153,9 @@ fun Long?.orZero(): Long = this ?: 0L
* @since 1.1.0
* @return [Float] value or **Zero**
*/
fun Float?.orZero(): Float = this ?: 0F
@JvmSynthetic
fun Float?.orZero(): Float =
this ?: 0F

/**
* Return zero when number is null.
Expand All @@ -98,4 +168,6 @@ fun Float?.orZero(): Float = this ?: 0F
* @since 1.1.0
* @return [Double] value or **Zero**
*/
fun Double?.orZero(): Double = this ?: 0.0
@JvmSynthetic
fun Double?.orZero(): Double =
this ?: 0.0
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package com.parsuomash.affogato.core.ktx
* @see let
* @see also
*/
@JvmSynthetic
inline fun <T> T.runBlock(block: () -> Unit): T {
val old = this
block()
Expand Down Expand Up @@ -51,6 +52,7 @@ inline fun <T> T.runBlock(block: () -> Unit): T {
),
level = DeprecationLevel.WARNING
)
@JvmSynthetic
inline fun <T> T.block(block: () -> Unit): T {
val old = this
block()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ fun <T> counter(content: Iterable<T>): Map<T, Int> =
* @since 1.1.0
* @return [T] value or **default**
*/
@JvmSynthetic
fun <T> T?.orDefault(default: T): T =
this ?: default

Expand All @@ -205,6 +206,7 @@ fun <T> T?.orDefault(default: T): T =
* @since 1.1.0
* @return [Boolean]
*/
@JvmSynthetic
fun <T> T?.isNull(): Boolean =
this == null

Expand All @@ -222,6 +224,7 @@ fun <T> T?.isNull(): Boolean =
* @since 1.1.0
* @return [Boolean]
*/
@JvmSynthetic
fun <T> T?.isNotNull(): Boolean =
this != null

Expand All @@ -247,6 +250,7 @@ fun <T> T?.isNotNull(): Boolean =
* @since 1.1.0
* @return value or [Unit]
*/
@JvmSynthetic
inline fun <T> T?.ifNull(block: (T?) -> Any): Any =
this ?: block(this)

Expand All @@ -272,6 +276,7 @@ inline fun <T> T?.ifNull(block: (T?) -> Any): Any =
* @since 1.1.0
* @return value or [Unit]
*/
@JvmSynthetic
inline fun <T, R> T?.ifNotNull(block: (T) -> R): R? =
if (this != null) block(this) else this

Expand Down
Loading

0 comments on commit de00e6b

Please sign in to comment.