Class ReturnFields

    • 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.

        Specified by:
        iterator in interface Iterable<String>
        Returns:
        iterator over child fields to be included in response.
      • isEmpty

        public boolean isEmpty()
        Determine if zero fields should be returned.
        Returns:
        true if the list is empty, else, false
      • isAll

        public boolean isAll()