Skip to content

Commit bd22188

Browse files
committed
Release 2.2.0.1-eap
update some code
1 parent bf5ee9a commit bd22188

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ apply plugin: 'kotlin'
2020
apply plugin: 'org.jetbrains.intellij'
2121

2222
group 'wu.seal'
23-
version '2.2-eap'
23+
version '2.2.0.1-eap'
2424

2525
intellij {
2626
version '2017.1'

src/main/kotlin/wu/seal/jsontokotlin/interceptor/InterceptorManager.kt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,22 @@ import wu.seal.jsontokotlin.ConfigManager
44

55
object InterceptorManager {
66

7-
fun getEnabledKotlinDataClassInterceptors() :List<IKotlinDataClassInterceptor>{
7+
fun getEnabledKotlinDataClassInterceptors(): List<IKotlinDataClassInterceptor> {
88

9-
val interceptors = mutableListOf<IKotlinDataClassInterceptor>()
10-
if (ConfigManager.enableMinimalAnnotation) {
11-
interceptors.add(MinimalAnnotationKotlinDataClassInterceptor())
12-
}
9+
return mutableListOf<IKotlinDataClassInterceptor>().apply {
10+
11+
if (ConfigManager.enableMinimalAnnotation) {
12+
add(MinimalAnnotationKotlinDataClassInterceptor())
13+
}
1314

14-
if (ConfigManager.parenClassTemplate.isNotBlank()) {
15-
interceptors.add(ParentClassTemplateKotlinDataClassInterceptor())
15+
if (ConfigManager.parenClassTemplate.isNotBlank()) {
16+
add(ParentClassTemplateKotlinDataClassInterceptor())
17+
}
1618
}
17-
return interceptors
1819
}
1920

2021

21-
fun getEnabledImportClassDeclarationInterceptors(): List<IImportClassDeclarationInterceptor>{
22+
fun getEnabledImportClassDeclarationInterceptors(): List<IImportClassDeclarationInterceptor> {
2223

2324
return mutableListOf<IImportClassDeclarationInterceptor>().apply {
2425

src/main/kotlin/wu/seal/jsontokotlin/interceptor/MinimalAnnotationKotlinDataClassInterceptor.kt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import wu.seal.jsontokotlin.classscodestruct.KotlinDataClass
44

55
/**
66
* interceptor to make the code to be like the minimal annotation
7+
* which means that if the property name is the same as raw name then remove the
8+
* annotations contains %s
79
*/
810
class MinimalAnnotationKotlinDataClassInterceptor() : IKotlinDataClassInterceptor {
911

@@ -27,14 +29,7 @@ class MinimalAnnotationKotlinDataClassInterceptor() : IKotlinDataClassIntercepto
2729
}
2830
}
2931

30-
return if (kotlinDataClass.nestedClasses.isNotEmpty()) {
31-
32-
val newNestedClasses = kotlinDataClass.nestedClasses.map { intercept(it) }
33-
kotlinDataClass.copy(properties = newProperties, nestedClasses = newNestedClasses)
34-
35-
} else {
36-
kotlinDataClass.copy(properties = newProperties)
37-
}
32+
return kotlinDataClass.copy(properties = newProperties)
3833

3934
}
4035

0 commit comments

Comments
 (0)