Interface CanonicalValueValidator<T extends CanonicalValue<T>,​V extends T>

    • Method Detail

      • getRepresentationClass

        Class<T> getRepresentationClass()
        Returns the instantiated representation class. The representation class is a CanonicalValue which understands the semantics of modeled data and has some internal representation of it. All CanonicalValues which share the same representation class are considered equal if their internal state would result in the same canonical string representation as defined by the YANG data model.
        Returns:
        Representation CanonicalValue class.
      • getValidatedRepresentationClass

        Class<V> getValidatedRepresentationClass()
        Return the class which captures the fact it was validated by this validator.
        Returns:
        Validated capture of the representation class.
      • validateRepresentation

        default Variant<T,​CanonicalValueViolation> validateRepresentation​(T value)
        Validate a CanonicalValue representation. Implementations should override this method if they can provide a validation algorithm which does not rely on canonical strings but works on representation state only.
        Parameters:
        value - Representation value
        Returns:
        Validated representation or a CanonicalValueViolation
        Throws:
        NullPointerException - if value is null
      • validateRepresentation

        Variant<T,​CanonicalValueViolation> validateRepresentation​(T value,
                                                                        String canonicalString)
        Validate a CanonicalValue representation. Implementations can chose whether they operate on representation state or canonical string -- both are considered equivalent. Users should call this method if they have a representation readily available.
        Parameters:
        value - Representation value
        canonicalString - Canonical string matching the representation value
        Returns:
        Validated representation or a CanonicalValueViolation
        Throws:
        NullPointerException - if value or canonicalString is null.