T
- canonical value typeV
- validated canonical value type@Beta
@NonNullByDefault
public interface CanonicalValueValidator<T extends CanonicalValue<T>,V extends T>
CanonicalValue
validator interface. Implementations of this interface can perform further validation of
representation state such that it conforms to a YANG type derived from a type with a CanonicalValue
representation.
Note: this interface should not be directly implemented. Use AbstractCanonicalValueValidator
instead.
Modifier and Type | Method and Description |
---|---|
Class<T> |
getRepresentationClass()
Returns the instantiated representation class.
|
Class<V> |
getValidatedRepresentationClass()
Return the class which captures the fact it was validated by this validator.
|
default Variant<T,CanonicalValueViolation> |
validateRepresentation(T value)
Validate a
CanonicalValue representation. |
Variant<T,CanonicalValueViolation> |
validateRepresentation(T value,
String canonicalString)
Validate a
CanonicalValue representation. |
Class<T> getRepresentationClass()
CanonicalValue
which
understands the semantics of modeled data and has some internal representation of it. All CanonicalValue
s
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.CanonicalValue
class.Class<V> getValidatedRepresentationClass()
default Variant<T,CanonicalValueViolation> validateRepresentation(T value)
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.value
- Representation valueCanonicalValueViolation
NullPointerException
- if value
is nullVariant<T,CanonicalValueViolation> validateRepresentation(T value, String canonicalString)
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.value
- Representation valuecanonicalString
- Canonical string matching the representation valueCanonicalValueViolation
NullPointerException
- if value
or canonicalString
is null.Copyright © 2019 OpenDaylight. All rights reserved.