View Javadoc
1   
2   /*
3    * Copyright (c) 2011-2022 PrimeFaces Extensions
4    *
5    *  Permission is hereby granted, free of charge, to any person obtaining a copy
6    *  of this software and associated documentation files (the "Software"), to deal
7    *  in the Software without restriction, including without limitation the rights
8    *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9    *  copies of the Software, and to permit persons to whom the Software is
10   *  furnished to do so, subject to the following conditions:
11   *
12   *  The above copyright notice and this permission notice shall be included in
13   *  all copies or substantial portions of the Software.
14   *
15   *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16   *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17   *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18   *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19   *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20   *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21   *  THE SOFTWARE.
22   */
23  
24  package org.primefaces.extensions.model.monacoeditor;
25  
26  import org.primefaces.shaded.json.*;
27  import java.io.ObjectStreamException;
28  import java.io.Serializable;
29  
30  // ============================================================
31  // THIS FILE WAS GENERATED AUTOMATICALLY. DO NOT EDIT DIRECTLY.
32  // ============================================================
33  
34  /**
35   * Options for whether unchanged regions should be hidden or visible.
36   */
37  @SuppressWarnings("serial")
38  public class EditorHideUnchangedRegions extends JSONObject implements Serializable {
39      private Object writeReplace() throws ObjectStreamException {
40          return new SerializedEditorHideUnchangedRegions(this);
41      }
42  
43      private static class SerializedEditorHideUnchangedRegions implements Serializable {
44          private String json;
45  
46          public SerializedEditorHideUnchangedRegions(EditorHideUnchangedRegions editorHideUnchangedRegions) {
47              this.json = editorHideUnchangedRegions.toString();
48          }
49  
50          private Object readResolve() throws ObjectStreamException {
51              final EditorHideUnchangedRegions editorHideUnchangedRegions = new EditorHideUnchangedRegions();
52              final JSONObject data = new JSONObject(json);
53              for (final String key : data.keySet()) {
54                  final Object value = data.get(key);
55                  editorHideUnchangedRegions.put(key, value);
56              }
57              return editorHideUnchangedRegions;
58          }
59      }
60  
61      public Number getContextLineCount() {
62          return (Number) (has("contextLineCount") ? get("contextLineCount") : null);
63      }
64  
65      public EditorHideUnchangedRegions setContextLineCount(final Number contextLineCount) {
66          put("contextLineCount", contextLineCount);
67          return this;
68      }
69  
70      public Boolean isEnabled() {
71          return (Boolean) (has("enabled") ? get("enabled") : null);
72      }
73  
74      public EditorHideUnchangedRegions setEnabled(final Boolean enabled) {
75          put("enabled", enabled);
76          return this;
77      }
78  
79      public Number getMinimumLineCount() {
80          return (Number) (has("minimumLineCount") ? get("minimumLineCount") : null);
81      }
82  
83      public EditorHideUnchangedRegions setMinimumLineCount(final Number minimumLineCount) {
84          put("minimumLineCount", minimumLineCount);
85          return this;
86      }
87  
88      public Number getRevealLineCount() {
89          return (Number) (has("revealLineCount") ? get("revealLineCount") : null);
90      }
91  
92      public EditorHideUnchangedRegions setRevealLineCount(final Number revealLineCount) {
93          put("revealLineCount", revealLineCount);
94          return this;
95      }
96  
97      /**
98       * @return This options object as a serializable JSON object
99       */
100     JSONObject getJSONObject() {
101         return this;
102     }
103 }