Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c28675f

Browse files
committedFeb 26, 2024··
add minimal impl
1 parent 2718421 commit c28675f

File tree

1 file changed

+14
-0
lines changed
  • airbyte-cdk/java/airbyte-cdk/typing-deduping/src/main/java/io/airbyte/integrations/base/destination/typing_deduping/migrators

1 file changed

+14
-0
lines changed
 

‎airbyte-cdk/java/airbyte-cdk/typing-deduping/src/main/java/io/airbyte/integrations/base/destination/typing_deduping/migrators/MinimumDestinationState.kt

+14
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,18 @@ interface MinimumDestinationState {
2626
* ```
2727
*/
2828
fun <T: MinimumDestinationState> withSoftReset(needsSoftReset: Boolean): T
29+
30+
/**
31+
* A minimal implementation of [MinimumDestinationState]. This is useful for destinations that don't
32+
* want to bother implementing a full state object.
33+
*/
34+
data class Impl(val needsSoftReset: Boolean): MinimumDestinationState {
35+
override fun needsSoftReset(): Boolean {
36+
return needsSoftReset
37+
}
38+
39+
override fun <T: MinimumDestinationState> withSoftReset(needsSoftReset: Boolean): T {
40+
return copy(needsSoftReset = true) as T
41+
}
42+
}
2943
}

0 commit comments

Comments
 (0)
Please sign in to comment.