4848 */
4949@ ApiModel (description = "DTO container with compare documents options." )
5050public class CompareOptions implements ModelIfc {
51+ /**
52+ * Gets or sets the option indicating whether changes are tracked by character or by word.
53+ */
54+ @ JsonAdapter (GranularityEnum .Adapter .class )
55+ public enum GranularityEnum {
56+ CHARLEVEL ("CharLevel" ),
57+ WORDLEVEL ("WordLevel" );
58+
59+ private String value ;
60+
61+ GranularityEnum (String value ) {
62+ this .value = value ;
63+ }
64+
65+ public String getValue () {
66+ return value ;
67+ }
68+
69+ @ Override
70+ public String toString () {
71+ return String .valueOf (value );
72+ }
73+
74+ public static GranularityEnum fromValue (String text ) {
75+ for (GranularityEnum b : GranularityEnum .values ()) {
76+ if (String .valueOf (b .value ).equals (text )) {
77+ return b ;
78+ }
79+ }
80+ return null ;
81+ }
82+
83+ public static class Adapter extends TypeAdapter < GranularityEnum > {
84+ @ Override
85+ public void write (final JsonWriter jsonWriter , final GranularityEnum enumeration ) throws IOException {
86+ jsonWriter .value (enumeration .getValue ());
87+ }
88+
89+ @ Override
90+ public GranularityEnum read (final JsonReader jsonReader ) throws IOException {
91+ String value = jsonReader .nextString ();
92+ return GranularityEnum .fromValue (String .valueOf (value ));
93+ }
94+ }
95+ }
96+
5197 /**
5298 * Gets or sets the option that controls which document shall be used as a target during comparison.
5399 */
@@ -97,6 +143,9 @@ public TargetEnum read(final JsonReader jsonReader) throws IOException {
97143 @ SerializedName ("AcceptAllRevisionsBeforeComparison" )
98144 protected Boolean acceptAllRevisionsBeforeComparison ;
99145
146+ @ SerializedName ("Granularity" )
147+ protected GranularityEnum granularity ;
148+
100149 @ SerializedName ("IgnoreCaseChanges" )
101150 protected Boolean ignoreCaseChanges ;
102151
@@ -142,6 +191,25 @@ public void setAcceptAllRevisionsBeforeComparison(Boolean acceptAllRevisionsBefo
142191 }
143192
144193
194+ /**
195+ * Gets or sets the option indicating whether changes are tracked by character or by word.
196+ * @return granularity
197+ **/
198+ @ ApiModelProperty (value = "Gets or sets the option indicating whether changes are tracked by character or by word." )
199+ public GranularityEnum getGranularity () {
200+ return granularity ;
201+ }
202+
203+ public CompareOptions granularity (GranularityEnum granularity ) {
204+ this .granularity = granularity ;
205+ return this ;
206+ }
207+
208+ public void setGranularity (GranularityEnum granularity ) {
209+ this .granularity = granularity ;
210+ }
211+
212+
145213 /**
146214 * Gets or sets a value indicating whether documents comparison is case insensitive. By default comparison is case sensitive.
147215 * @return ignoreCaseChanges
@@ -315,6 +383,7 @@ public void setTarget(TargetEnum target) {
315383
316384 public CompareOptions () {
317385 this .acceptAllRevisionsBeforeComparison = null ;
386+ this .granularity = null ;
318387 this .ignoreCaseChanges = null ;
319388 this .ignoreComments = null ;
320389 this .ignoreFields = null ;
@@ -356,6 +425,7 @@ public boolean equals(java.lang.Object o) {
356425 CompareOptions compareOptions = (CompareOptions ) o ;
357426 return
358427 Objects .equals (this .acceptAllRevisionsBeforeComparison , compareOptions .acceptAllRevisionsBeforeComparison ) &&
428+ Objects .equals (this .granularity , compareOptions .granularity ) &&
359429 Objects .equals (this .ignoreCaseChanges , compareOptions .ignoreCaseChanges ) &&
360430 Objects .equals (this .ignoreComments , compareOptions .ignoreComments ) &&
361431 Objects .equals (this .ignoreFields , compareOptions .ignoreFields ) &&
@@ -369,14 +439,15 @@ public boolean equals(java.lang.Object o) {
369439
370440 @ Override
371441 public int hashCode () {
372- return Objects .hash (acceptAllRevisionsBeforeComparison , ignoreCaseChanges , ignoreComments , ignoreFields , ignoreFootnotes , ignoreFormatting , ignoreHeadersAndFooters , ignoreTables , ignoreTextboxes , target );
442+ return Objects .hash (acceptAllRevisionsBeforeComparison , granularity , ignoreCaseChanges , ignoreComments , ignoreFields , ignoreFootnotes , ignoreFormatting , ignoreHeadersAndFooters , ignoreTables , ignoreTextboxes , target );
373443 }
374444
375445 @ Override
376446 public String toString () {
377447 StringBuilder sb = new StringBuilder ();
378448 sb .append ("class CompareOptions {\n " );
379449 sb .append (" acceptAllRevisionsBeforeComparison: " ).append (toIndentedString (getAcceptAllRevisionsBeforeComparison ())).append ("\n " );
450+ sb .append (" granularity: " ).append (toIndentedString (getGranularity ())).append ("\n " );
380451 sb .append (" ignoreCaseChanges: " ).append (toIndentedString (getIgnoreCaseChanges ())).append ("\n " );
381452 sb .append (" ignoreComments: " ).append (toIndentedString (getIgnoreComments ())).append ("\n " );
382453 sb .append (" ignoreFields: " ).append (toIndentedString (getIgnoreFields ())).append ("\n " );
0 commit comments