-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from edward3h/container_sqlarray
Container sqlarray
- Loading branch information
Showing
25 changed files
with
379 additions
and
158 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
processor/src/main/java/org/ethelred/kiwiproc/processor/AssignmentConversion.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,23 @@ | ||
package org.ethelred.kiwiproc.processor; | ||
|
||
import org.jspecify.annotations.Nullable; | ||
|
||
/** | ||
* It's not really a conversion. | ||
*/ | ||
public record AssignmentConversion() implements Conversion { | ||
@Override | ||
public boolean isValid() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean hasWarning() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public @Nullable String warning() { | ||
return null; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
processor/src/main/java/org/ethelred/kiwiproc/processor/Conversion.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,17 @@ | ||
package org.ethelred.kiwiproc.processor; | ||
|
||
import org.jspecify.annotations.Nullable; | ||
|
||
public sealed interface Conversion | ||
permits AssignmentConversion, | ||
FromSqlArrayConversion, | ||
InvalidConversion, | ||
NullableSourceConversion, | ||
StringFormatConversion, | ||
ToSqlArrayConversion { | ||
boolean isValid(); | ||
|
||
boolean hasWarning(); | ||
|
||
@Nullable String warning(); | ||
} |
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
23 changes: 23 additions & 0 deletions
23
processor/src/main/java/org/ethelred/kiwiproc/processor/FromSqlArrayConversion.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,23 @@ | ||
package org.ethelred.kiwiproc.processor; | ||
|
||
import org.ethelred.kiwiproc.processor.types.ContainerType; | ||
import org.ethelred.kiwiproc.processor.types.SqlArrayType; | ||
import org.jspecify.annotations.Nullable; | ||
|
||
public record FromSqlArrayConversion(SqlArrayType sat, ContainerType ct, Conversion elementConversion) | ||
implements Conversion { | ||
@Override | ||
public boolean isValid() { | ||
return elementConversion.isValid(); | ||
} | ||
|
||
@Override | ||
public boolean hasWarning() { | ||
return elementConversion.hasWarning(); | ||
} | ||
|
||
@Override | ||
public @Nullable String warning() { | ||
return elementConversion.warning(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
processor/src/main/java/org/ethelred/kiwiproc/processor/InvalidConversion.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,20 @@ | ||
package org.ethelred.kiwiproc.processor; | ||
|
||
import org.jspecify.annotations.Nullable; | ||
|
||
public record InvalidConversion() implements Conversion { | ||
@Override | ||
public boolean isValid() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean hasWarning() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public @Nullable String warning() { | ||
return null; | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
processor/src/main/java/org/ethelred/kiwiproc/processor/NullableSourceConversion.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,20 @@ | ||
package org.ethelred.kiwiproc.processor; | ||
|
||
import org.jspecify.annotations.Nullable; | ||
|
||
public record NullableSourceConversion(Conversion conversion) implements Conversion { | ||
@Override | ||
public boolean isValid() { | ||
return conversion.isValid(); | ||
} | ||
|
||
@Override | ||
public boolean hasWarning() { | ||
return conversion.hasWarning(); | ||
} | ||
|
||
@Override | ||
public @Nullable String warning() { | ||
return conversion.warning(); | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
processor/src/main/java/org/ethelred/kiwiproc/processor/StringFormatConversion.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,14 @@ | ||
package org.ethelred.kiwiproc.processor; | ||
|
||
import org.jspecify.annotations.Nullable; | ||
|
||
public record StringFormatConversion(@Nullable String warning, String conversionFormat) implements Conversion { | ||
public boolean hasWarning() { | ||
return warning != null; | ||
} | ||
|
||
@Override | ||
public boolean isValid() { | ||
return true; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
processor/src/main/java/org/ethelred/kiwiproc/processor/ToSqlArrayConversion.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,23 @@ | ||
package org.ethelred.kiwiproc.processor; | ||
|
||
import org.ethelred.kiwiproc.processor.types.ContainerType; | ||
import org.ethelred.kiwiproc.processor.types.SqlArrayType; | ||
import org.jspecify.annotations.Nullable; | ||
|
||
public record ToSqlArrayConversion(ContainerType ct, SqlArrayType sat, Conversion elementConversion) | ||
implements Conversion { | ||
@Override | ||
public boolean isValid() { | ||
return elementConversion.isValid(); | ||
} | ||
|
||
@Override | ||
public boolean hasWarning() { | ||
return elementConversion.hasWarning(); | ||
} | ||
|
||
@Override | ||
public @Nullable String warning() { | ||
return elementConversion.warning(); | ||
} | ||
} |
Oops, something went wrong.