Skip to content

Commit

Permalink
fixup: update
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Schrottner <[email protected]>
  • Loading branch information
aepfli committed Oct 7, 2024
1 parent 5fd9b3d commit 4bc8e86
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 46 deletions.
3 changes: 1 addition & 2 deletions src/main/java/dev/openfeature/sdk/EventSupport.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package dev.openfeature.sdk;

import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -13,6 +11,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import lombok.extern.slf4j.Slf4j;

/**
* Util class for storing and running handlers.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.openfeature.sdk;

import java.util.Optional;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import lombok.Builder;
import lombok.Singular;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/openfeature/sdk/Hook.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface Hook<T> {
* @param ctx Information about the particular flag evaluation
* @param hints An immutable mapping of data for users to communicate to the hooks.
* @return An optional {@link EvaluationContext}. If returned, it will be merged with the EvaluationContext
* instances from other hooks, the client and API.
* instances from other hooks, the client and API.
*/
default Optional<EvaluationContext> before(HookContext<T> ctx, Map<String, Object> hints) {
return Optional.empty();
Expand Down
1 change: 0 additions & 1 deletion src/main/java/dev/openfeature/sdk/HookSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/openfeature/sdk/ImmutableContext.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package dev.openfeature.sdk;

import dev.openfeature.sdk.internal.ExcludeFromGeneratedCoverageReport;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import dev.openfeature.sdk.internal.ExcludeFromGeneratedCoverageReport;
import lombok.ToString;
import lombok.experimental.Delegate;

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/dev/openfeature/sdk/ImmutableMetadata.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package dev.openfeature.sdk;

import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

import java.util.HashMap;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;

/**
* Immutable Flag Metadata representation. Implementation is backed by a {@link Map} and immutability is provided
Expand Down
1 change: 0 additions & 1 deletion src/main/java/dev/openfeature/sdk/ImmutableStructure.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.Map;
import java.util.Optional;
import java.util.Set;

import lombok.EqualsAndHashCode;
import lombok.ToString;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dev/openfeature/sdk/MutableContext.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package dev.openfeature.sdk;

import dev.openfeature.sdk.internal.ExcludeFromGeneratedCoverageReport;
import java.time.Instant;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import dev.openfeature.sdk.internal.ExcludeFromGeneratedCoverageReport;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Delegate;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/dev/openfeature/sdk/MutableStructure.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;

import lombok.EqualsAndHashCode;
import lombok.ToString;

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
import dev.openfeature.sdk.exceptions.OpenFeatureError;
import dev.openfeature.sdk.internal.AutoCloseableLock;
import dev.openfeature.sdk.internal.AutoCloseableReentrantReadWriteLock;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.Consumer;
import lombok.extern.slf4j.Slf4j;

/**
* A global singleton which holds base configuration for the OpenFeature
Expand Down
13 changes: 6 additions & 7 deletions src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package dev.openfeature.sdk;

import dev.openfeature.sdk.exceptions.ExceptionUtils;
import dev.openfeature.sdk.exceptions.GeneralError;
import dev.openfeature.sdk.exceptions.OpenFeatureError;
import dev.openfeature.sdk.internal.AutoCloseableLock;
import dev.openfeature.sdk.internal.AutoCloseableReentrantReadWriteLock;
import dev.openfeature.sdk.internal.ObjectUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;

import dev.openfeature.sdk.exceptions.GeneralError;
import dev.openfeature.sdk.exceptions.OpenFeatureError;
import dev.openfeature.sdk.internal.AutoCloseableLock;
import dev.openfeature.sdk.internal.AutoCloseableReentrantReadWriteLock;
import dev.openfeature.sdk.exceptions.ExceptionUtils;
import dev.openfeature.sdk.internal.ObjectUtils;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.openfeature.sdk;

import java.util.List;

import lombok.Data;
import lombok.experimental.SuperBuilder;

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/dev/openfeature/sdk/ProviderRepository.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package dev.openfeature.sdk;

import dev.openfeature.sdk.exceptions.GeneralError;
import dev.openfeature.sdk.exceptions.OpenFeatureError;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand All @@ -12,9 +14,6 @@
import java.util.function.Consumer;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import dev.openfeature.sdk.exceptions.GeneralError;
import dev.openfeature.sdk.exceptions.OpenFeatureError;
import lombok.extern.slf4j.Slf4j;

@Slf4j
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/dev/openfeature/sdk/Structure.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package dev.openfeature.sdk;

import dev.openfeature.sdk.exceptions.ValueNotConvertableError;
import static dev.openfeature.sdk.Value.objectToValue;

import dev.openfeature.sdk.exceptions.ValueNotConvertableError;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;

import static dev.openfeature.sdk.Value.objectToValue;

/**
* {@link Structure} represents a potentially nested object type which is used to represent
* structured data.
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/dev/openfeature/sdk/Value.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package dev.openfeature.sdk;

import static dev.openfeature.sdk.Structure.mapToStructure;

import dev.openfeature.sdk.exceptions.TypeMismatchError;
import java.time.Instant;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import dev.openfeature.sdk.exceptions.TypeMismatchError;
import lombok.EqualsAndHashCode;
import lombok.SneakyThrows;
import lombok.ToString;

import static dev.openfeature.sdk.Structure.mapToStructure;

/**
* Values serve as a generic return type for structure data from providers.
* Providers may deal in JSON, protobuf, XML or some other data-interchange format.
Expand Down Expand Up @@ -40,7 +39,7 @@ public Value() {
*
* @param value to be wrapped.
* @throws InstantiationException if value is not a valid type
* (boolean, string, int, double, list, structure, instant)
* (boolean, string, int, double, list, structure, instant)
*/
public Value(Object value) throws InstantiationException {
this.innerObject = value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package dev.openfeature.sdk.internal;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

/**
* JaCoCo ignores coverage of methods annotated with any annotation with "generated" in the name.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ExcludeFromGeneratedCoverageReport {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.Map;
import java.util.function.Supplier;
import java.util.stream.Collectors;

import lombok.experimental.UtilityClass;

@SuppressWarnings("checkstyle:MissingJavadocType")
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/dev/openfeature/sdk/providers/memory/Flag.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package dev.openfeature.sdk.providers.memory;

import java.util.Map;
import lombok.Builder;
import lombok.Getter;
import lombok.Singular;
import lombok.ToString;

import java.util.Map;

/**
* Flag representation for the in-memory provider.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@
import dev.openfeature.sdk.exceptions.OpenFeatureError;
import dev.openfeature.sdk.exceptions.ProviderNotReadyError;
import dev.openfeature.sdk.exceptions.TypeMismatchError;
import lombok.Getter;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import lombok.Getter;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;

/**
* In-memory provider.
Expand Down
2 changes: 1 addition & 1 deletion test-harness

0 comments on commit 4bc8e86

Please sign in to comment.