File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
src/main/java/org/skyscreamer/jsonassert Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -74,16 +74,28 @@ public boolean hasStrictOrder() {
7474 }
7575
7676 /**
77- * @return the non-strict equivalent.
77+ * Get the equivalent {@code JSONCompareMode} with or without strict ordering.
78+ *
79+ * @return the equivalent {@code JSONCompareMode}
7880 */
79- public JSONCompareMode butNotStrict () {
80- return isExtensible () ? LENIENT : NON_EXTENSIBLE ;
81+ public JSONCompareMode withStrictOrdering (boolean strictOrdering ) {
82+ if (strictOrdering ) {
83+ return isExtensible () ? STRICT_ORDER : STRICT ;
84+ } else {
85+ return isExtensible () ? LENIENT : NON_EXTENSIBLE ;
86+ }
8187 }
8288
8389 /**
84- * @return the extensible equivalent.
90+ * Get the equivalent {@code JSONCompareMode} with or without extensibility.
91+ *
92+ * @return the equivalent {@code JSONCompareMode}
8593 */
86- public JSONCompareMode withExtensibility () {
87- return hasStrictOrder () ? STRICT_ORDER : LENIENT ;
94+ public JSONCompareMode withExtensible (boolean extensible ) {
95+ if (extensible ) {
96+ return hasStrictOrder () ? STRICT_ORDER : LENIENT ;
97+ } else {
98+ return hasStrictOrder () ? STRICT : NON_EXTENSIBLE ;
99+ }
88100 }
89101}
You can’t perform that action at this time.
0 commit comments