-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
airbyte-5050: Added GenericParamType
- Loading branch information
1 parent
f5815b0
commit d557456
Showing
14 changed files
with
92 additions
and
17 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...rations/bases/base-java/src/main/java/io/airbyte/integrations/types/GenericParamType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.airbyte.integrations.types; | ||
|
||
/** | ||
* This class used as the generic type parameter to define the type of the parameter. | ||
* Could be useful fot specific situations when we need to have a generic type parameter | ||
* | ||
* @see io.airbyte.integrations.destination.redshift.RedshiftDestination | ||
*/ | ||
public class GenericParamType<T> { | ||
|
||
private T t; | ||
|
||
public GenericParamType(T t) { | ||
this.t = t; | ||
} | ||
|
||
public void set(T t) { | ||
this.t = t; | ||
} | ||
|
||
public T get() { | ||
return t; | ||
} | ||
|
||
public static <T> GenericParamType<T> of(T t) { | ||
return new GenericParamType<>(t); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...ons/bases/base-java/src/test/java/io/airbyte/integrations/types/GenericParamTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.airbyte.integrations.types; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class GenericParamTypeTest { | ||
|
||
private GenericParamType<String> genericParamType; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
genericParamType = new GenericParamType("sd"); | ||
} | ||
|
||
@Test | ||
public void testGet() { | ||
String result = genericParamType.get(); | ||
assertEquals("sd", result); | ||
} | ||
|
||
@Test | ||
public void testOf() { | ||
GenericParamType<String> genericParamType = GenericParamType.of("sd"); | ||
assertEquals("sd", genericParamType.get()); | ||
} | ||
|
||
@Test | ||
public void testSet() { | ||
genericParamType.set("test"); | ||
assertEquals("java.lang.String", genericParamType.get().getClass().getName()); | ||
assertEquals("test", genericParamType.get()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d557456
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SonarQube Report
SonarQube report for Airbyte Connectors Destination Clickhouse(#12064)
Measures
Detected Issues
Coverage (0.0%)
d557456
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SonarQube Report
SonarQube report for Airbyte Connectors Destination Mariadb Columnstore(#12064)
Measures
Detected Issues
Coverage (0.0%)
d557456
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SonarQube Report
SonarQube report for Airbyte Connectors Destination Databricks(#12064)
Measures
Detected Issues
Coverage (0.0%)