Skip to content

Commit 1263af7

Browse files
committed
Improve naming and extensions in Kotlin module and release 1.11.2
1 parent 45cb3c4 commit 1263af7

File tree

10 files changed

+36
-14
lines changed

10 files changed

+36
-14
lines changed

.github/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ repositories {
3636
3737
dependencies {
3838
// Default
39-
implementation 'net.dzikoysk:cdn:1.11.1'
39+
implementation 'net.dzikoysk:cdn:1.11.2'
4040
// Kotlin wrapper
41-
implementation 'net.dzikoysk:cdn-kt:1.11.1'
41+
implementation 'net.dzikoysk:cdn-kt:1.11.2'
4242
}
4343
```
4444

cdn-kt/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<artifactId>cdn-parent</artifactId>
2121
<groupId>net.dzikoysk</groupId>
22-
<version>1.11.1</version>
22+
<version>1.11.2</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

cdn-kt/src/main/kotlin/net/dzikoysk/cdn/KCdnSettingsExtension.kt renamed to cdn-kt/src/main/kotlin/net/dzikoysk/cdn/CdnSettingsExtensions.kt

File renamed without changes.

cdn-kt/src/main/kotlin/net/dzikoysk/cdn/KCdn.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ import kotlin.reflect.KClass
2323

2424
class KCdn(val cdn: Cdn) {
2525

26-
companion object
26+
companion object {
27+
fun configure(): CdnSettings = CdnSettings()
28+
}
2729

2830
fun parse(source: Source): KConfiguration = KConfiguration(cdn.load(source))
2931

@@ -39,8 +41,4 @@ class KCdn(val cdn: Cdn) {
3941

4042
}
4143

42-
fun Cdn.toKotlinWrapper(): KCdn =
43-
KCdn(this)
44-
45-
fun KCdn.Companion.configure(): CdnSettings =
46-
CdnSettings()
44+
fun Cdn.toKotlinWrapper(): KCdn = KCdn(this)

cdn-kt/src/main/kotlin/net/dzikoysk/cdn/KCdnFactory.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package net.dzikoysk.cdn
1818

1919
object KCdnFactory {
2020

21+
@JvmStatic
2122
fun createStandard(): KCdn =
2223
Cdn.configure()
2324
.registerKotlinModule()

cdn-kt/src/main/kotlin/net/dzikoysk/cdn/annotation/KFunctionMember.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import java.lang.reflect.AnnotatedType
55
import kotlin.reflect.KFunction
66
import kotlin.reflect.jvm.*
77

8-
class KFunctionMember(
8+
internal class KFunctionMember(
99
private val instance: Any,
1010
private val getter: KFunction<*>,
1111
private val setter: KFunction<*>,

cdn-kt/src/main/kotlin/net/dzikoysk/cdn/annotation/KPropertyMember.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import kotlin.reflect.KMutableProperty
66
import kotlin.reflect.jvm.javaField
77
import kotlin.reflect.jvm.javaGetter
88

9-
class KPropertyMember(private val instance: Any, private val property: KMutableProperty<*>) : AnnotatedMember {
9+
internal class KPropertyMember(private val instance: Any, private val property: KMutableProperty<*>) : AnnotatedMember {
1010

1111
override fun setValue(value: Any?) {
1212
property.setter.call(instance, value)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2021 dzikoysk
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package net.dzikoysk.cdn.model
18+
19+
fun <T : Any> reference(value: T): Reference<T> =
20+
Reference.reference(value)
21+
22+
fun <T : Any> mutableReference(value: T): MutableReference<T> =
23+
MutableReference.mutableReference(value)

cdn/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<artifactId>cdn-parent</artifactId>
2121
<groupId>net.dzikoysk</groupId>
22-
<version>1.11.1</version>
22+
<version>1.11.2</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<groupId>net.dzikoysk</groupId>
2424
<artifactId>cdn-parent</artifactId>
2525
<packaging>pom</packaging>
26-
<version>1.11.1</version>
26+
<version>1.11.2</version>
2727

2828
<scm>
2929
<connection>scm:git:https://github.com/dzikoysk/cdn.git</connection>
@@ -63,7 +63,7 @@
6363
<dependency>
6464
<groupId>net.dzikoysk</groupId>
6565
<artifactId>cdn</artifactId>
66-
<version>1.11.1</version>
66+
<version>1.11.2</version>
6767
</dependency>
6868

6969
<!-- General -->

0 commit comments

Comments
 (0)