Class JsTupleSpec

  • All Implemented Interfaces:
    JsArraySpec, JsSpec

    public final class JsTupleSpec
    extends java.lang.Object
    implements JsArraySpec
    Represents a specification of every element of a Json array. It allows to define tuples and the schema of every of its elements.
    • Method Detail

      • isRequired

        public boolean isRequired()
        Description copied from interface: JsSpec
        Returns whether the key is optional.
        Specified by:
        isRequired in interface JsSpec
        Returns:
        whether the key is optional.
      • nullable

        public JsTupleSpec nullable()
        Description copied from interface: JsSpec
        Returns the same spec with the nullable flag enabled
        Specified by:
        nullable in interface JsSpec
        Returns:
        the same spec with the nullable flag enabled
      • optional

        public JsTupleSpec optional()
        Description copied from interface: JsSpec
        Returns the same spec with the optional flag enabled
        Specified by:
        optional in interface JsSpec
        Returns:
        the same spec with the optional flag enabled
      • parser

        public JsSpecParser parser()
        Description copied from interface: JsSpec
        Returns the deserializer used during the parsing process to parse an array of bytes or string
        Specified by:
        parser in interface JsSpec
        Returns:
        the deserializer used during the parsing process to parse an array of bytes or string into a json value
      • test

        public java.util.Set<JsErrorPair> test​(JsPath parentPath,
                                               JsValue value)
        Description copied from interface: JsSpec
        verify if the given value satisfy this spec.
        Specified by:
        test in interface JsSpec
        Parameters:
        parentPath - the path where the tested value is located.
        value - the tested value
        Returns:
        a set of path/error pairs