Skip to content

Commit a0217ed

Browse files
committed
update
1 parent 7a2ee00 commit a0217ed

File tree

8 files changed

+36
-0
lines changed

8 files changed

+36
-0
lines changed

aws-dynamodb/src/main/java/com/formkiq/aws/dynamodb/objects/Strings.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ public class Strings {
4747
/** Scheme Authority. */
4848
private static final String SCHEME_AUTHORITY = "://";
4949

50+
/**
51+
* Return text or elseText if the text is empty.
52+
*
53+
* @param text {@link String}
54+
* @param elseText {@link String}
55+
* @return {@link String}
56+
*/
57+
public static String isNotNullOrEmptyElse(final String text, final String elseText) {
58+
return !isEmpty(text) ? text : elseText;
59+
}
60+
5061
private static String findMatch(final Collection<String> resourceUrls,
5162
final List<String[]> resourceSplits, final String path) {
5263

aws-dynamodb/src/test/java/com/formkiq/aws/dynamodb/objects/StringsTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,11 @@ void testTruncate01() {
116116
assertEquals("ab", Strings.truncate("ab", 2));
117117
assertEquals("ab", Strings.truncate("abc", 2));
118118
}
119+
120+
@Test
121+
void testIsNotNullOrEmptyElse() {
122+
assertEquals("A", Strings.isNotNullOrEmptyElse("", "A"));
123+
assertEquals("A", Strings.isNotNullOrEmptyElse(null, "A"));
124+
assertEquals("B", Strings.isNotNullOrEmptyElse("B", "A"));
125+
}
119126
}

docs/openapi/openapi-iam.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8880,6 +8880,9 @@
88808880
$ref: '#/components/schemas/DocumentGenerateDataSource'
88818881
outputType:
88828882
$ref: '#/components/schemas/DocumentGenerateOutputType'
8883+
saveAsDocumentId:
8884+
type: string
8885+
description: Save the generated document with a specific documentId
88838886
DocumentGenerateDataSource:
88848887
type: object
88858888
required:

docs/openapi/openapi-jwt.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8880,6 +8880,9 @@
88808880
$ref: '#/components/schemas/DocumentGenerateDataSource'
88818881
outputType:
88828882
$ref: '#/components/schemas/DocumentGenerateOutputType'
8883+
saveAsDocumentId:
8884+
type: string
8885+
description: Save the generated document with a specific documentId
88838886
DocumentGenerateDataSource:
88848887
type: object
88858888
required:

docs/openapi/openapi-key.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8880,6 +8880,9 @@
88808880
$ref: '#/components/schemas/DocumentGenerateDataSource'
88818881
outputType:
88828882
$ref: '#/components/schemas/DocumentGenerateOutputType'
8883+
saveAsDocumentId:
8884+
type: string
8885+
description: Save the generated document with a specific documentId
88838886
DocumentGenerateDataSource:
88848887
type: object
88858888
required:

lambda-api-graalvm/src/main/resources/cloudformation/openapi-iam.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8954,6 +8954,9 @@ Resources:
89548954
$ref: "#/components/schemas/DocumentGenerateDataSource"
89558955
outputType:
89568956
$ref: "#/components/schemas/DocumentGenerateOutputType"
8957+
saveAsDocumentId:
8958+
type: "string"
8959+
description: "Save the generated document with a specific documentId"
89578960

89588961
DocumentGenerateDataSource:
89598962
type: "object"

lambda-api-graalvm/src/main/resources/cloudformation/openapi-jwt.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8954,6 +8954,9 @@ Resources:
89548954
$ref: "#/components/schemas/DocumentGenerateDataSource"
89558955
outputType:
89568956
$ref: "#/components/schemas/DocumentGenerateOutputType"
8957+
saveAsDocumentId:
8958+
type: "string"
8959+
description: "Save the generated document with a specific documentId"
89578960

89588961
DocumentGenerateDataSource:
89598962
type: "object"

lambda-api-graalvm/src/main/resources/cloudformation/openapi-key.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8954,6 +8954,9 @@ Resources:
89548954
$ref: "#/components/schemas/DocumentGenerateDataSource"
89558955
outputType:
89568956
$ref: "#/components/schemas/DocumentGenerateOutputType"
8957+
saveAsDocumentId:
8958+
type: "string"
8959+
description: "Save the generated document with a specific documentId"
89578960

89588961
DocumentGenerateDataSource:
89598962
type: "object"

0 commit comments

Comments
 (0)