File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed
src/main/java/org/javawebstack/abstractdata Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change 77 <properties >
88 <maven .compiler.source>8</maven .compiler.source>
99 <maven .compiler.target>8</maven .compiler.target>
10- <buildVersion >1.0.2 -SNAPSHOT</buildVersion >
10+ <buildVersion >1.0.3 -SNAPSHOT</buildVersion >
1111 </properties >
1212
1313 <groupId >org.javawebstack</groupId >
Original file line number Diff line number Diff line change @@ -65,10 +65,22 @@ public boolean isObject() {
6565 return true ;
6666 }
6767
68- public AbstractObject object () {
68+ public AbstractObject object (boolean strict ) throws AbstractCoercingException {
6969 return this ;
7070 }
7171
72+ public AbstractArray array (boolean strict ) throws AbstractCoercingException {
73+ if (strict )
74+ throw new AbstractCoercingException (Type .ARRAY , Type .OBJECT );
75+ AbstractArray array = new AbstractArray ();
76+ for (int i = 0 ; i < size (); i ++) {
77+ if (!has (String .valueOf (i )))
78+ throw new AbstractCoercingException (Type .ARRAY , this );
79+ array .add (get (String .valueOf (i )));
80+ }
81+ return array ;
82+ }
83+
7284 public AbstractElement get (String key ) {
7385 return entries .get (key );
7486 }
@@ -127,18 +139,6 @@ public int size() {
127139 return entries .size ();
128140 }
129141
130- public AbstractArray array (boolean strict ) throws AbstractCoercingException {
131- if (strict )
132- throw new AbstractCoercingException (Type .ARRAY , Type .OBJECT );
133- AbstractArray array = new AbstractArray ();
134- for (int i = 0 ; i < size (); i ++) {
135- if (!has (String .valueOf (i )))
136- throw new AbstractCoercingException (Type .ARRAY , this );
137- array .add (get (String .valueOf (i )));
138- }
139- return array ;
140- }
141-
142142 public AbstractObject object (String key ) throws AbstractCoercingException {
143143 return query (key , AbstractNull .VALUE ).object ();
144144 }
You can’t perform that action at this time.
0 commit comments