forked from eugenp/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BAEL-19886] - moved related articles to the new core-kotlin-modules/…
…core-kotlin module
- Loading branch information
1 parent
202c7d6
commit f145e70
Showing
42 changed files
with
106 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Core Kotlin | ||
|
||
This module contains articles about Kotlin core features. | ||
|
||
### Relevant articles: | ||
- [Introduction to the Kotlin Language](https://www.baeldung.com/kotlin) | ||
- [Kotlin Java Interoperability](https://www.baeldung.com/kotlin-java-interoperability) | ||
- [Get a Random Number in Kotlin](https://www.baeldung.com/kotlin-random-number) | ||
- [Create a Java and Kotlin Project with Maven](https://www.baeldung.com/kotlin-maven-java-project) | ||
- [Guide to Sorting in Kotlin](https://www.baeldung.com/kotlin-sort) | ||
- [Creational Design Patterns in Kotlin: Builder](https://www.baeldung.com/kotlin-builder-pattern) | ||
- [Kotlin Scope Functions](https://www.baeldung.com/kotlin-scope-functions) | ||
- [Implementing a Binary Tree in Kotlin](https://www.baeldung.com/kotlin-binary-tree) | ||
- [JUnit 5 for Kotlin Developers](https://www.baeldung.com/junit-5-kotlin) | ||
- [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>core-kotlin</artifactId> | ||
<name>core-kotlin</name> | ||
<packaging>jar</packaging> | ||
|
||
<parent> | ||
<groupId>com.baeldung.core-kotlin-modules</groupId> | ||
<artifactId>core-kotlin-modules</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit.platform</groupId> | ||
<artifactId>junit-platform-runner</artifactId> | ||
<version>${junit.platform.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<properties> | ||
<junit.platform.version>1.1.1</junit.platform.version> | ||
</properties> | ||
|
||
</project> |
2 changes: 1 addition & 1 deletion
2
.../java/com/baeldung/java/ArrayExample.java → ...eldung/interoperability/ArrayExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...main/java/com/baeldung/java/Customer.java → ...m/baeldung/interoperability/Customer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.baeldung.java; | ||
package com.baeldung.interoperability; | ||
|
||
public class Customer { | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...n/java/com/baeldung/java/StringUtils.java → ...om/baeldung/introduction/StringUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
...baeldung/mavenjavakotlin/Application.java → ...baeldung/mavenjavakotlin/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...otlin/com/baeldung/datastructures/Main.kt → ...in/kotlin/com/baeldung/binarytree/Main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...otlin/com/baeldung/datastructures/Node.kt → ...in/kotlin/com/baeldung/binarytree/Node.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...in/kotlin/com/baeldung/kotlin/Example1.kt → ...lin/com/baeldung/introduction/Example1.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...c/main/kotlin/com/baeldung/kotlin/Item.kt → .../kotlin/com/baeldung/introduction/Item.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...kotlin/com/baeldung/kotlin/ItemService.kt → .../com/baeldung/introduction/ItemService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.baeldung.kotlin | ||
package com.baeldung.introduction | ||
|
||
import java.util.* | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...tlin/com/baeldung/kotlin/ListExtension.kt → ...om/baeldung/introduction/ListExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.baeldung.kotlin | ||
package com.baeldung.introduction | ||
|
||
import java.util.concurrent.ThreadLocalRandom | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
.../baeldung/kotlin/MathematicsOperations.kt → ...ung/introduction/MathematicsOperations.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...mavenjavakotlin/services/KotlinService.kt → ...baeldung/mavenjavakotlin/KotlinService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.baeldung.mavenjavakotlin.services | ||
package com.baeldung.mavenjavakotlin | ||
|
||
class KotlinService { | ||
|
||
|
File renamed without changes.
2 changes: 0 additions & 2 deletions
2
...in/com/baeldung/sorting/SortingExample.kt → ...in/com/baeldung/sorting/SortingExample.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...dung/kotlin/JavaCallToKotlinUnitTest.java → ...ntroduction/JavaCallToKotlinUnitTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.baeldung.kotlin; | ||
package com.baeldung.introduction; | ||
|
||
import org.junit.Test; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
...t/kotlin/com/baeldung/kotlin/ArrayTest.kt → ...om/baeldung/interoperability/ArrayTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,37 @@ | ||
package com.baeldung.kotlin | ||
package com.baeldung.interoperability | ||
|
||
import com.baeldung.java.ArrayExample | ||
import com.baeldung.java.Customer | ||
import org.junit.Test | ||
import kotlin.test.assertEquals | ||
|
||
class ArrayTest { | ||
|
||
@Test | ||
fun givenArray_whenValidateArrayType_thenComplete () { | ||
val ex = ArrayExample() | ||
val ex = com.baeldung.interoperability.ArrayExample() | ||
val numArray = intArrayOf(1, 2, 3) | ||
|
||
assertEquals(ex.sumValues(numArray), 6) | ||
} | ||
|
||
@Test | ||
fun givenCustomer_whenGetSuperType_thenComplete() { | ||
val instance = Customer::class | ||
val instance = com.baeldung.interoperability.Customer::class | ||
val supertypes = instance.supertypes | ||
|
||
assertEquals(supertypes[0].toString(), "kotlin.Any") | ||
} | ||
|
||
@Test | ||
fun givenCustomer_whenGetConstructor_thenComplete() { | ||
val instance = Customer::class.java | ||
val instance = com.baeldung.interoperability.Customer::class.java | ||
val constructors = instance.constructors | ||
|
||
assertEquals(constructors.size, 1) | ||
assertEquals(constructors[0].name, "com.baeldung.java.Customer") | ||
assertEquals(constructors[0].name, "com.baeldung.interoperability.Customer") | ||
} | ||
|
||
fun makeReadFile() { | ||
val ax = ArrayExample() | ||
val ax = com.baeldung.interoperability.ArrayExample() | ||
ax.writeList() | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
...otlin/com/baeldung/kotlin/CustomerTest.kt → ...baeldung/interoperability/CustomerTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...in/com/baeldung/kotlin/ItemServiceTest.kt → .../baeldung/introduction/ItemServiceTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
.../kotlin/KotlinJavaInteroperabilityTest.kt → ...duction/KotlinJavaInteroperabilityTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
.../kotlin/com/baeldung/kotlin/LambdaTest.kt → ...n/com/baeldung/introduction/LambdaTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
.../com/baeldung/kotlin/ListExtensionTest.kt → ...aeldung/introduction/ListExtensionTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../com/baeldung/kotlin/junit5/Calculator.kt → .../kotlin/com/baeldung/junit5/Calculator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...baeldung/kotlin/junit5/CalculatorTest5.kt → ...com/baeldung/junit5/CalculatorUnitTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ng/kotlin/junit5/DivideByZeroException.kt → .../baeldung/junit5/DivideByZeroException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package com.baeldung.kotlin.junit5 | ||
package com.baeldung.junit5 | ||
|
||
class DivideByZeroException(val numerator: Int) : Exception() |
4 changes: 2 additions & 2 deletions
4
...com/baeldung/kotlin/junit5/SimpleTest5.kt → ...lin/com/baeldung/junit5/SimpleUnitTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
.../baeldung/sorting/SortingExampleKtTest.kt → .../baeldung/sorting/SortingExampleKtTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.