Class NodeValue

  • All Implemented Interfaces:
    au.com.dius.pact.core.model.Into

    
    public class NodeValue
     implements Into<NodeValue>
                        

    Enum for the value stored in a leaf node

    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String strForm() Returns the encoded string form of the node value
      final String valueType() Returns the type of the value
      final NodeValue and(NodeValue other) Calculates an AND of two values
      final NodeValue or(NodeValue other) Calculates an OR of two values
      final Boolean truthy() Convert this value into a boolean using a "truthy" test
      final JsonValue asJson() If this value is a JSON value, returns it, otherwise returns null
      final String asString() If this value is a String value, returns it, otherwise returns null
      final XmlValue asXml() If this value is an XML value, returns it, otherwise returns null
      final Boolean asBool() If this value is a bool value, returns it, otherwise returns null
      final UInt asUInt() If this value is an UInt value, returns it, otherwise returns null
      final List<String> asSList() If this value is a string list, returns it, otherwise returns null
      final List<NodeValue> toList() Converts this value into a list of values
      NodeValue into()
      final Object unwrap() Returns the inner value if the NodeValue
      final static String escape(String value)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • strForm

         final String strForm()

        Returns the encoded string form of the node value

      • truthy

         final Boolean truthy()

        Convert this value into a boolean using a "truthy" test

      • asJson

         final JsonValue asJson()

        If this value is a JSON value, returns it, otherwise returns null

      • asString

         final String asString()

        If this value is a String value, returns it, otherwise returns null

      • asXml

         final XmlValue asXml()

        If this value is an XML value, returns it, otherwise returns null

      • asBool

         final Boolean asBool()

        If this value is a bool value, returns it, otherwise returns null

      • asUInt

         final UInt asUInt()

        If this value is an UInt value, returns it, otherwise returns null

      • asSList

         final List<String> asSList()

        If this value is a string list, returns it, otherwise returns null

      • unwrap

         final Object unwrap()

        Returns the inner value if the NodeValue