[BAEL-19885] - Move articles out of core-kotlin part4

This commit is contained in:
catalin-burcea
2019-12-27 13:36:41 +02:00
parent b63a8c2335
commit 3254a03d8a
44 changed files with 194 additions and 57 deletions
-3
View File
@@ -5,7 +5,4 @@ This module contains articles about core Kotlin.
### Relevant articles:
- [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)
- [Finding an Element in a List Using Kotlin](https://www.baeldung.com/kotlin-finding-element-in-list)
- More articles: [[<-- prev]](/core-kotlin)
@@ -0,0 +1,11 @@
## Core Kotlin Advanced
This module contains articles about advanced topics in Kotlin.
### Relevant articles:
- [Building DSLs in Kotlin](https://www.baeldung.com/kotlin-dsl)
- [Regular Expressions in Kotlin](https://www.baeldung.com/kotlin-regular-expressions)
- [Idiomatic Logging in Kotlin](https://www.baeldung.com/kotlin-logging)
- [Mapping of Data Objects in Kotlin](https://www.baeldung.com/kotlin-data-objects)
- [Reflection with Kotlin](https://www.baeldung.com/kotlin-reflection)
- [Kotlin Contracts](https://www.baeldung.com/kotlin-contracts)
@@ -0,0 +1,41 @@
<?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-advanced</artifactId>
<name>core-kotlin-advanced</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.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<kotlin.version>1.3.30</kotlin.version>
<assertj.version>3.10.0</assertj.version>
</properties>
</project>
@@ -3,10 +3,10 @@ package com.baeldung.datamapping
import kotlin.reflect.full.memberProperties
fun User.toUserView() = UserView(
name = "$firstName $lastName",
address = "$street $houseNumber",
telephone = phone,
age = age
name = "$firstName $lastName",
address = "$street $houseNumber",
telephone = phone,
age = age
)
fun User.toUserViewReflection() = with(::UserView) {
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.dsl
package com.baeldung.dsl
abstract class Condition {
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.logging
package com.baeldung.logging
import org.slf4j.Logger
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.logging
package com.baeldung.logging
import org.slf4j.Logger
import org.slf4j.LoggerFactory
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.logging
package com.baeldung.logging
open class LoggerAsProperty {
private val logger = getLogger(javaClass)
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.logging
package com.baeldung.logging
import org.slf4j.Logger
import kotlin.properties.ReadOnlyProperty
@@ -43,5 +43,5 @@ fun main(args: Array<String>) {
class LoggerDelegate<in R : Any> : ReadOnlyProperty<R, Logger> {
override fun getValue(thisRef: R, property: KProperty<*>) =
getLogger(getClassForLogging(thisRef.javaClass))
getLogger(getClassForLogging(thisRef.javaClass))
}
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.logging
package com.baeldung.logging
open class LoggerInCompanionObject {
companion object {
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.logging
package com.baeldung.logging
import org.slf4j.Logger
import org.slf4j.LoggerFactory
@@ -1,8 +1,7 @@
package com.baeldung.kotlin.dsl
package com.baeldung.dsl
import org.assertj.core.api.Assertions.assertThat
import org.junit.Test
import java.lang.Exception
class SqlDslTest {
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.reflection
package com.baeldung.reflection
import org.junit.Ignore
import org.junit.Test
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.reflection
package com.baeldung.reflection
import org.junit.Assert
import org.junit.Ignore
@@ -1,4 +1,4 @@
package com.baeldung.kotlin.reflection
package com.baeldung.reflection
import org.junit.Assert
import org.junit.Test
@@ -1,12 +1,7 @@
package com.baeldung.kotlin.stdlib
package com.baeldung.regex
import org.junit.Test
import java.beans.ExceptionListener
import java.beans.XMLEncoder
import java.io.*
import java.lang.Exception
import kotlin.test.*
import kotlin.text.RegexOption.*
class RegexTest {
@@ -0,0 +1,10 @@
## Core Kotlin Collections
This module contains articles about core Kotlin collections.
### Relevant articles:
- [Split a List Into Parts in Kotlin](https://www.baeldung.com/kotlin-split-list-into-parts)
- [Finding an Element in a List Using Kotlin](https://www.baeldung.com/kotlin-finding-element-in-list)
- [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)
- [Filtering Kotlin Collections](https://www.baeldung.com/kotlin-filter-collection)
@@ -0,0 +1,47 @@
<?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-collections</artifactId>
<name>core-kotlin-collections</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.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>${commons-math3.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<kotlin.version>1.3.30</kotlin.version>
<commons-math3.version>3.6.1</commons-math3.version>
<assertj.version>3.10.0</assertj.version>
</properties>
</project>
@@ -1,9 +1,9 @@
package com.baeldung.kotlin
package com.baeldung.collections
import org.junit.Test
import kotlin.test.assertTrue
import kotlin.test.assertFalse
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
class CollectionsTest {
@@ -142,5 +142,5 @@ class CollectionsTest {
val finalResult = theList.fold( 1000, { oldResult, currentItem -> oldResult + (currentItem *currentItem)})
print(finalResult)
assertEquals(1091, finalResult)
}
}
}

Some files were not shown because too many files have changed in this diff Show More