Skip to content

Commit

Permalink
[BAEL-19883] - Move articles out of core-kotlin part2
Browse files Browse the repository at this point in the history
  • Loading branch information
catalin-burcea committed Dec 16, 2019
1 parent 2e1d1ff commit b34da5a
Show file tree
Hide file tree
Showing 58 changed files with 85 additions and 41 deletions.
3 changes: 0 additions & 3 deletions core-kotlin-2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ This module contains articles about core Kotlin.

### Relevant articles:

- [Void Type in Kotlin](https://www.baeldung.com/kotlin-void-type)
- [How to use Kotlin Range Expressions](https://www.baeldung.com/kotlin-ranges)
- [Creating a Kotlin Range Iterator on a Custom Object](https://www.baeldung.com/kotlin-custom-range-iterator)
- [Kotlin Scope Functions](https://www.baeldung.com/kotlin-scope-functions)
- [Kotlin Annotations](https://www.baeldung.com/kotlin-annotations)
- [Split a List into Parts in Kotlin](https://www.baeldung.com/kotlin-split-list-into-parts)
Expand Down
13 changes: 13 additions & 0 deletions core-kotlin-modules/core-kotlin-lang-2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Core Kotlin Lang

This module contains articles about core features in the Kotlin language.

### Relevant articles:
- [Kotlin return, break, continue Keywords](https://www.baeldung.com/kotlin-return-break-continue)
- [Infix Functions in Kotlin](https://www.baeldung.com/kotlin-infix-functions)
- [Lambda Expressions in Kotlin](https://www.baeldung.com/kotlin-lambda-expressions)
- [Creating Java static final Equivalents in Kotlin](https://www.baeldung.com/kotlin-java-static-final)
- [Initializing Arrays in Kotlin](https://www.baeldung.com/kotlin-initialize-array)
- [Lazy Initialization in Kotlin](https://www.baeldung.com/kotlin-lazy-initialization)
- [Comprehensive Guide to Null Safety in Kotlin](https://www.baeldung.com/kotlin-null-safety)
- [[<-- Prev]](/core-kotlin-modules/core-kotlin-lang)
16 changes: 16 additions & 0 deletions core-kotlin-modules/core-kotlin-lang-2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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-lang-2</artifactId>
<name>core-kotlin-lang-2</name>
<packaging>jar</packaging>

<parent>
<groupId>com.baeldung.core-kotlin-modules</groupId>
<artifactId>core-kotlin-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

</project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.baeldung.kotlin;
package com.baeldung.lazy;


import com.baeldung.lazy.ClassWithHeavyInitialization;
import org.junit.Test;

import static junit.framework.TestCase.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.arrayinitialization

import org.junit.Test
import kotlin.test.assertEquals
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.baeldung.kotlin.constant.TestKotlinConstantClass
import com.baeldung.kotlin.constant.TestKotlinConstantObject
package com.baeldung.constant

import org.junit.jupiter.api.Test
import kotlin.test.assertEquals

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.constant
package com.baeldung.constant


class TestKotlinConstantClass {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.constant
package com.baeldung.constant


object TestKotlinConstantObject {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.infixfunctions

import org.junit.Assert
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test
import kotlin.test.assertEquals

class LambdaTest {

@Test
fun whenCallingALambda_thenPerformTheAction() {
assertEquals(9, inferredType(3))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.lazy

import org.junit.Test
import java.util.concurrent.CountDownLatch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.nullsafety

import org.junit.Test
import kotlin.test.assertEquals
Expand All @@ -8,6 +8,7 @@ import kotlin.test.assertTrue


class NullSafetyTest {

@Test
fun givenNonNullableField_whenAssignValueToIt_thenNotNeedToCheckAgainstNull() {
//given
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.structuraljump

import org.junit.Test
import kotlin.test.assertEquals
Expand Down
16 changes: 16 additions & 0 deletions core-kotlin-modules/core-kotlin-lang/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Core Kotlin Lang

This module contains articles about core features in the Kotlin language.

### Relevant articles:
- [Guide to the “when{}” Block in Kotlin](https://www.baeldung.com/kotlin-when)
- [Difference Between “==” and “===” Operators in Kotlin](https://www.baeldung.com/kotlin-equality-operators)
- [Nested forEach in Kotlin](https://www.baeldung.com/kotlin-nested-foreach)
- [Destructuring Declarations in Kotlin](https://www.baeldung.com/kotlin-destructuring-declarations)
- [Try-with-resources in Kotlin](https://www.baeldung.com/kotlin-try-with-resources)
- [Operator Overloading in Kotlin](https://www.baeldung.com/kotlin-operator-overloading)
- [Inline Functions in Kotlin](https://www.baeldung.com/kotlin-inline-functions)
- [Void Type in Kotlin](https://www.baeldung.com/kotlin-void-type)
- [How to use Kotlin Range Expressions](https://www.baeldung.com/kotlin-ranges)
- [Creating a Kotlin Range Iterator on a Custom Object](https://www.baeldung.com/kotlin-custom-range-iterator)
- [[More --> ]](/core-kotlin-modules/core-kotlin-lang-2)
16 changes: 16 additions & 0 deletions core-kotlin-modules/core-kotlin-lang/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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-lang</artifactId>
<name>core-kotlin-lang</name>
<packaging>jar</packaging>

<parent>
<groupId>com.baeldung.core-kotlin-modules</groupId>
<artifactId>core-kotlin-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>

</project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.baeldung.destructuringdeclarations

import com.baeldung.destructuringdeclarations.Person

fun main(args: Array<String>) {

//2.1. Objects
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.baeldung.kotlin
package com.baeldung.equalityoperators

data class User(val name: String, val age: Int, val hobbies: List<String>)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.functions
package com.baeldung.inline

import kotlin.random.Random

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.range
package com.baeldung.rangeiterator

import java.lang.IllegalStateException

Expand All @@ -8,7 +8,7 @@ class CustomColor(val rgb: Int): Comparable<CustomColor> {
return this.rgb.compareTo(other.rgb)
}

operator fun rangeTo(that: CustomColor) = ColorRange(this,that)
operator fun rangeTo(that: CustomColor) = ColorRange(this, that)

operator fun inc(): CustomColor {
return CustomColor(rgb + 1)
Expand All @@ -25,7 +25,7 @@ class CustomColor(val rgb: Int): Comparable<CustomColor> {
}
}
class ColorRange(override val start: CustomColor,
override val endInclusive: CustomColor) : ClosedRange<CustomColor>, Iterable<CustomColor>{
override val endInclusive: CustomColor) : ClosedRange<CustomColor>, Iterable<CustomColor>{

override fun iterator(): Iterator<CustomColor> {
return ColorIterator(start, endInclusive)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.whenblock

enum class UnixFileType {
D, HYPHEN_MINUS, L
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.equalityoperators

import org.junit.Test
import kotlin.test.assertFalse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.range
package com.baeldung.rangeiterator

import org.junit.Test
import java.lang.IllegalStateException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.trywithresource

import org.junit.Test
import java.beans.ExceptionListener
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.baeldung.kotlin
package com.baeldung.whenblock

import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
Expand Down
2 changes: 2 additions & 0 deletions core-kotlin-modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<modules>
<module>core-kotlin-annotations</module>
<module>core-kotlin-io</module>
<module>core-kotlin-lang</module>
<module>core-kotlin-lang-2</module>
<module>core-kotlin-strings</module>
</modules>

Expand Down
14 changes: 0 additions & 14 deletions core-kotlin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,19 @@ This module contains articles about core Kotlin.
### Relevant articles:

- [Introduction to the Kotlin Language](https://www.baeldung.com/kotlin)
- [Guide to the “when{}” Block in Kotlin](https://www.baeldung.com/kotlin-when)
- [Comprehensive Guide to Null Safety in Kotlin](https://www.baeldung.com/kotlin-null-safety)
- [Kotlin Java Interoperability](https://www.baeldung.com/kotlin-java-interoperability)
- [Difference Between “==” and “===” operators in Kotlin](https://www.baeldung.com/kotlin-equality-operators)
- [Generics in Kotlin](https://www.baeldung.com/kotlin-generics)
- [Introduction to Kotlin Coroutines](https://www.baeldung.com/kotlin-coroutines)
- [Destructuring Declarations in Kotlin](https://www.baeldung.com/kotlin-destructuring-declarations)
- [Lazy Initialization in Kotlin](https://www.baeldung.com/kotlin-lazy-initialization)
- [Overview of Kotlin Collections API](https://www.baeldung.com/kotlin-collections-api)
- [Converting a List to Map in Kotlin](https://www.baeldung.com/kotlin-list-to-map)
- [Data Classes in Kotlin](https://www.baeldung.com/kotlin-data-classes)
- [Delegated Properties in Kotlin](https://www.baeldung.com/kotlin-delegated-properties)
- [Sealed Classes in Kotlin](https://www.baeldung.com/kotlin-sealed-classes)
- [JUnit 5 for Kotlin Developers](https://www.baeldung.com/junit-5-kotlin)
- [Extension Methods in Kotlin](https://www.baeldung.com/kotlin-extension-methods)
- [Infix Functions in Kotlin](https://www.baeldung.com/kotlin-infix-functions)
- [Try-with-resources in Kotlin](https://www.baeldung.com/kotlin-try-with-resources)
- [Regular Expressions in Kotlin](https://www.baeldung.com/kotlin-regular-expressions)
- [Objects in Kotlin](https://www.baeldung.com/kotlin-objects)
- [Filtering Kotlin Collections](https://www.baeldung.com/kotlin-filter-collection)
- [Lambda Expressions in Kotlin](https://www.baeldung.com/kotlin-lambda-expressions)
- [Working with Enums in Kotlin](https://www.baeldung.com/kotlin-enum)
- [Create a Java and Kotlin Project with Maven](https://www.baeldung.com/kotlin-maven-java-project)
- [Reflection with Kotlin](https://www.baeldung.com/kotlin-reflection)
Expand All @@ -37,21 +29,15 @@ This module contains articles about core Kotlin.
- [Fuel HTTP Library with Kotlin](https://www.baeldung.com/kotlin-fuel)
- [Introduction to Kovenant Library for Kotlin](https://www.baeldung.com/kotlin-kovenant)
- [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class)
- [Kotlin return, break, continue Keywords](https://www.baeldung.com/kotlin-return-break-continue)
- [Mapping of Data Objects in Kotlin](https://www.baeldung.com/kotlin-data-objects)
- [Initializing Arrays in Kotlin](https://www.baeldung.com/kotlin-initialize-array)
- [Threads vs Coroutines in Kotlin](https://www.baeldung.com/kotlin-threads-coroutines)
- [Guide to Kotlin Interfaces](https://www.baeldung.com/kotlin-interfaces)
- [Guide to Sorting in Kotlin](https://www.baeldung.com/kotlin-sort)
- [Dependency Injection for Kotlin with Injekt](https://www.baeldung.com/kotlin-dependency-injection-with-injekt)
- [Implementing a Binary Tree in Kotlin](https://www.baeldung.com/kotlin-binary-tree)
- [Kotlin Contracts](https://www.baeldung.com/kotlin-contracts)
- [Operator Overloading in Kotlin](https://www.baeldung.com/kotlin-operator-overloading)
- [Inline Classes in Kotlin](https://www.baeldung.com/kotlin-inline-classes)
- [Creating Java static final Equivalents in Kotlin](https://www.baeldung.com/kotlin-java-static-final)
- [Nested forEach in Kotlin](https://www.baeldung.com/kotlin-nested-foreach)
- [Building DSLs in Kotlin](https://www.baeldung.com/kotlin-dsl)
- [Static Methods Behavior in Kotlin](https://www.baeldung.com/kotlin-static-methods)
- [Inline Functions in Kotlin](https://www.baeldung.com/kotlin-inline-functions)
- [Delegation Pattern in Kotlin](https://www.baeldung.com/kotlin-delegation-pattern)
- More articles: [[next -->]](/core-kotlin-2)

0 comments on commit b34da5a

Please sign in to comment.