Class ReturnFields
- java.lang.Object
-
- org.keycloak.client.admin.cli.util.ReturnFields
-
-
Field Summary
Fields Modifier and Type Field Description static ReturnFieldsALLstatic ReturnFieldsALL_RECURSIVELYstatic ReturnFieldsNONE
-
Constructor Summary
Constructors Constructor Description ReturnFields()ReturnFields(String spec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReturnFieldschild(String field)Get ReturnFields for a child field of JSONObject type.booleanexcluded(String field)Check to see if the field specified is set to be explicitly excluded.booleanincluded(String... pathSegments)Check to see if the field should be included in JSON response.booleanisAll()booleanisEmpty()Determine if zero fields should be returned.Iterator<String>iterator()Iterate over child fields to be included in response.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
ALL
public static ReturnFields ALL
-
NONE
public static ReturnFields NONE
-
ALL_RECURSIVELY
public static ReturnFields ALL_RECURSIVELY
-
-
Constructor Detail
-
ReturnFields
public ReturnFields()
-
ReturnFields
public ReturnFields(String spec)
-
-
Method Detail
-
child
public ReturnFields child(String field)
Get ReturnFields for a child field of JSONObject type.For basic-typed fields this always returns null. Use included() for those.
- Parameters:
field- The child field name for nested returns.- Returns:
- ReturnFields for a child field
-
included
public boolean included(String... pathSegments)
Check to see if the field should be included in JSON response.The check can be performed for any level of depth relative to current nesting level, by specifying multiple path segments.
- Parameters:
pathSegments- Segments to test in the tree of return fields.- Returns:
- true if the specified path should be part of JSON response or not
-
excluded
public boolean excluded(String field)
Check to see if the field specified is set to be explicitly excluded.- Parameters:
field- The field name to check- Returns:
- If the field was explicitly set to be excluded
-
iterator
public Iterator<String> iterator()
Iterate over child fields to be included in response.To get nested field specifier use child(name) passing the field name this iterator returns.
-
isEmpty
public boolean isEmpty()
Determine if zero fields should be returned.- Returns:
trueif the list is empty, else,false
-
isAll
public boolean isAll()
-
-