Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
Logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
mihxil committed Jul 7, 2023
1 parent 2477445 commit f634b06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
import lombok.extern.slf4j.Slf4j;

import java.util.*;
import java.util.stream.Collectors;

import org.checkerframework.checker.nullness.qual.NonNull;

import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.nullness.qual.NonNull;

import nl.vpro.io.prepr.domain.PreprObjectMapper;

Expand Down Expand Up @@ -56,7 +54,7 @@ public static StandalonePreprRepositories fromMap(Map<String, String> configurat
.map(Map.Entry::getKey)
.filter((k) -> k.startsWith(prefix))
.map((k) -> k.substring(prefix.length()))
.collect(Collectors.toList());
.toList();
for (String channel : channels) {
String secret = configuration.get("prepr.clientSecret." + channel);
if (StringUtils.isNotEmpty(secret)) {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/nl/vpro/io/prepr/domain/PreprObjectMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.extern.slf4j.Slf4j;

import java.io.Serial;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.Optional;
Expand All @@ -27,6 +28,8 @@
public class PreprObjectMapper extends ObjectMapper {

public static final PreprObjectMapper INSTANCE = new PreprObjectMapper();
@Serial
private static final long serialVersionUID = -6294808396132210200L;

static {
INSTANCE.registerModule(new JavaTimeModule());
Expand All @@ -39,10 +42,12 @@ public static void configureInstance(boolean lenient) {
INSTANCE.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
INSTANCE.configure(JsonParser.Feature.ALLOW_COMMENTS, true); // always nice for examples
if (lenient) {
log.info("Configuring lenient");
INSTANCE.configure(JsonParser.Feature.IGNORE_UNDEFINED, true); // forward compatibility
INSTANCE.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);// forward compatibility
INSTANCE.enable(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE);
} else {
log.info("Configuring strict");
INSTANCE.configure(JsonParser.Feature.IGNORE_UNDEFINED, false);
INSTANCE.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
}
Expand All @@ -54,6 +59,7 @@ public static void configureInstance(boolean lenient) {

public static class PreprModule extends SimpleModule {

@Serial
private static final long serialVersionUID = 1L;

public PreprModule() {
Expand Down

0 comments on commit f634b06

Please sign in to comment.