Feature: upgraded lombok version to support latest versions of java (#830)
* Feature: upgraded lombok version to support latest versions of java * Bumped mapstruct version
This commit is contained in:
parent
859e9fb88d
commit
978ed3ad9b
5 changed files with 19 additions and 2 deletions
|
@ -205,6 +205,11 @@
|
|||
<artifactId>lombok</artifactId>
|
||||
<version>${org.projectlombok.version}</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-mapstruct-binding</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
|
|
|
@ -40,6 +40,7 @@ import java.util.stream.Collectors;
|
|||
import org.apache.kafka.clients.admin.ConfigEntry;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.Named;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ClusterMapper {
|
||||
|
@ -90,6 +91,7 @@ public interface ClusterMapper {
|
|||
|
||||
Partition toPartition(InternalPartition topic);
|
||||
|
||||
@Named("setSchemaRegistry")
|
||||
default InternalSchemaRegistry setSchemaRegistry(ClustersProperties.Cluster clusterProperties) {
|
||||
if (clusterProperties == null
|
||||
|| clusterProperties.getSchemaRegistry() == null) {
|
||||
|
@ -150,11 +152,13 @@ public interface ClusterMapper {
|
|||
return brokerDiskUsage;
|
||||
}
|
||||
|
||||
@Named("mapDiskUsage")
|
||||
default List<BrokerDiskUsage> mapDiskUsage(Map<Integer, InternalBrokerDiskUsage> brokers) {
|
||||
return brokers.entrySet().stream().map(e -> this.map(e.getKey(), e.getValue()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Named("sumMetrics")
|
||||
default BigDecimal sumMetrics(Map<String, BigDecimal> metrics) {
|
||||
if (metrics != null) {
|
||||
return metrics.values().stream().reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
@ -163,6 +167,7 @@ public interface ClusterMapper {
|
|||
}
|
||||
}
|
||||
|
||||
@Named("resolvePath")
|
||||
default Path resolvePath(String path) {
|
||||
if (path != null) {
|
||||
return Path.of(path);
|
||||
|
@ -171,6 +176,7 @@ public interface ClusterMapper {
|
|||
}
|
||||
}
|
||||
|
||||
@Named("setProperties")
|
||||
default Properties setProperties(Properties properties) {
|
||||
Properties copy = new Properties();
|
||||
if (properties != null) {
|
||||
|
|
|
@ -4,11 +4,14 @@ import java.nio.file.Path;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Builder(toBuilder = true)
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class KafkaCluster {
|
||||
private final String name;
|
||||
private final String version;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package com.provectus.kafka.ui.model;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Builder(toBuilder = true)
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class KafkaConnectCluster {
|
||||
private final String name;
|
||||
private final String address;
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -16,8 +16,8 @@
|
|||
|
||||
<spring-boot.version>2.2.4.RELEASE</spring-boot.version>
|
||||
<jackson-databind-nullable.version>0.2.1</jackson-databind-nullable.version>
|
||||
<org.mapstruct.version>1.3.1.Final</org.mapstruct.version>
|
||||
<org.projectlombok.version>1.18.10</org.projectlombok.version>
|
||||
<org.mapstruct.version>1.4.2.Final</org.mapstruct.version>
|
||||
<org.projectlombok.version>1.18.20</org.projectlombok.version>
|
||||
<org.projectlombok.e2e-checks.version>1.18.20</org.projectlombok.e2e-checks.version>
|
||||
<git.revision>latest</git.revision>
|
||||
<zookeper.version>3.5.7</zookeper.version>
|
||||
|
|
Loading…
Add table
Reference in a new issue