Interface CanonicalValueSupport<T extends CanonicalValue<T>>

    • Method Detail

      • fromString

        Variant<T,​CanonicalValueViolation> fromString​(String str)
        Create a instance for a string representation. Implementations of this method are required to perform checks equivalent to the YANG data model restrictions attached to the corresponding YANG type. Non-canonical format strings must be accepted and result in objects equal to objects obtained from the corresponding canonical format.
        Parameters:
        str - String representation
        Returns:
        A CanonicalValue instance or CanonicalValueViolation if str does not conform
        Throws:
        NullPointerException - if str is null
      • fromCanonicalString

        default Variant<T,​CanonicalValueViolation> fromCanonicalString​(String str)
        Create a instance for the canonical string representation. Implementations of this method may perform optimizations based on the assumption the string is canonical, but should still report errors when a mismatch is detected.
        Parameters:
        str - String representation
        Returns:
        A CanonicalValue instance or CanonicalValueViolation if str does not conform
        Throws:
        NullPointerException - if str is null