-
Notifications
You must be signed in to change notification settings - Fork 1
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 #70 from axonivy-market/feat/MARP-1280
feat/MARP-1280: Add Class for Keywords data type
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
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
61 changes: 61 additions & 0 deletions
61
docuware-connector/src/com/axonivy/connector/docuware/connector/DocuWareKeywordsField.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,61 @@ | ||
package com.axonivy.connector.docuware.connector; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
|
||
/** | ||
* DocuWareKeywordsField class to match the JSON format used by the Docuware rest | ||
* services for setting item value of {@link DocuWareProperty} which | ||
* type="Keywords". | ||
*/ | ||
@JsonPropertyOrder({ "$type", "Keyword" }) | ||
public class DocuWareKeywordsField { | ||
|
||
@JsonProperty(value = "$type") | ||
final private String type = "DocumentIndexFieldKeywords"; | ||
|
||
@JsonProperty(value = "Keyword") | ||
private List<String> keywords; | ||
|
||
public DocuWareKeywordsField() { | ||
keywords = new ArrayList<>(); | ||
} | ||
|
||
/** | ||
* @return the keywords | ||
*/ | ||
public List<String> getKeywords() { | ||
return keywords; | ||
} | ||
|
||
/** | ||
* @param keywords the keywords to set | ||
*/ | ||
public void setKeywords(List<String> keywords) { | ||
this.keywords = keywords; | ||
} | ||
|
||
/** | ||
* @return the type | ||
*/ | ||
public String getType() { | ||
return type; | ||
} | ||
|
||
/** | ||
* | ||
* @param value | ||
* Utility function to add keyword to the list | ||
*/ | ||
public void append(String value) { | ||
if (Objects.isNull(keywords)) { | ||
keywords = new ArrayList<>(); | ||
} | ||
keywords.add(value); | ||
} | ||
|
||
} |