Skip to content

Commit

Permalink
feat: #81 Some re-build magic - actually the Lombok-generated getters…
Browse files Browse the repository at this point in the history
… ARE working in Kotlin classes (even in IntelliJ IDEA).
  • Loading branch information
dmitry-weirdo committed Nov 21, 2024
1 parent 70b2799 commit 6c83724
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
14 changes: 14 additions & 0 deletions kgstatsSrv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,20 @@
<artifactId>lombok-mapstruct-binding</artifactId>
<version>${lombok-mapstruct-binding.version}</version>
</path>


<!--
Use Lombok-generated getters in Kotlin classes.
See https://www.baeldung.com/kotlin/lombok#3-using-kapt
-->
<!--
<annotationProcessorPath>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</annotationProcessorPath>
-->

</annotationProcessorPaths>
</configuration>

Expand Down
21 changes: 0 additions & 21 deletions kgstatsSrv/src/main/java/ru/klavogonki/statistics/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,6 @@ public class Config {
// @see ExportContext
private String statisticsPagesRootDir;

// Explicit non-Lombok getters added to make the usage from the Kotlin clas work (see ExportContext).
public int getMinPlayerId() {
return minPlayerId;
}

public int getMaxPlayerId() {
return maxPlayerId;
}

public OffsetDateTime getDataDownloadStartDate() {
return dataDownloadStartDate;
}

public OffsetDateTime getDataDownloadEndDate() {
return dataDownloadEndDate;
}

public String getStatisticsPagesRootDir() {
return statisticsPagesRootDir;
}

@JsonProperty(access = JsonProperty.Access.READ_ONLY) // do not de-serialize, there is no setter and no field
public int getTotalPlayers() {
return maxPlayerId - minPlayerId + 1;
Expand Down

0 comments on commit 6c83724

Please sign in to comment.