File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,9 @@ public final class com/javiersc/kotlin/stdlib/CollectionsKt {
158
158
159
159
public final class com/javiersc/kotlin/stdlib/StringsKt {
160
160
public static final fun isNotNullNorBlank (Ljava/lang/CharSequence;)Z
161
+ public static final fun isNotNullNorBlank (Ljava/lang/String;)Z
161
162
public static final fun isNotNullNorEmpty (Ljava/lang/CharSequence;)Z
163
+ public static final fun isNotNullNorEmpty (Ljava/lang/String;)Z
162
164
public static final fun remove (Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;
163
165
public static synthetic fun remove$default (Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
164
166
}
Original file line number Diff line number Diff line change @@ -22,3 +22,17 @@ public inline fun CharSequence?.isNotNullNorEmpty(): Boolean {
22
22
23
23
return this != null && isNotEmpty()
24
24
}
25
+
26
+ @OptIn(ExperimentalContracts ::class )
27
+ public inline fun String?.isNotNullNorBlank (): Boolean {
28
+ contract { returns(false ) implies (this @isNotNullNorBlank == null ) }
29
+
30
+ return this != null && isNotBlank()
31
+ }
32
+
33
+ @OptIn(ExperimentalContracts ::class )
34
+ public inline fun String?.isNotNullNorEmpty (): Boolean {
35
+ contract { returns(false ) implies (this @isNotNullNorEmpty == null ) }
36
+
37
+ return this != null && isNotEmpty()
38
+ }
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class CollectionsTest {
26
26
27
27
@Test
28
28
fun collection_fifth () {
29
- assertTrue { numbers.forth () == 5 }
29
+ assertTrue { numbers.fifth () == 5 }
30
30
}
31
31
32
32
@Test
You can’t perform that action at this time.
0 commit comments