T - string representation classV - validated string representation class@Beta @NonNullByDefault @ThreadSafe public abstract class AbstractCanonicalValueValidator<T extends DerivedString<T>,V extends T> extends Object implements CanonicalValueValidator<T,V>
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCanonicalValueValidator(CanonicalValueSupport<T> representationSupport,
Class<V> validatedClass) |
| 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.
|
protected org.opendaylight.yangtools.concepts.Variant<T,CanonicalValueViolation> |
validate(T value)
Validate a
DerivedString representation. |
protected abstract org.opendaylight.yangtools.concepts.Variant<T,CanonicalValueViolation> |
validate(T value,
String canonicalString)
Validate a
DerivedString representation. |
org.opendaylight.yangtools.concepts.Variant<T,CanonicalValueViolation> |
validateRepresentation(T value)
Validate a
CanonicalValue representation. |
org.opendaylight.yangtools.concepts.Variant<T,CanonicalValueViolation> |
validateRepresentation(T value,
String canonicalString)
Validate a
CanonicalValue representation. |
protected AbstractCanonicalValueValidator(CanonicalValueSupport<T> representationSupport, Class<V> validatedClass)
public final Class<T> getRepresentationClass()
CanonicalValueValidatorCanonicalValue 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.getRepresentationClass in interface CanonicalValueValidator<T extends DerivedString<T>,V extends T>CanonicalValue class.public final Class<V> getValidatedRepresentationClass()
CanonicalValueValidatorgetValidatedRepresentationClass in interface CanonicalValueValidator<T extends DerivedString<T>,V extends T>public final org.opendaylight.yangtools.concepts.Variant<T,CanonicalValueViolation> validateRepresentation(T value)
CanonicalValueValidatorCanonicalValue 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.validateRepresentation in interface CanonicalValueValidator<T extends DerivedString<T>,V extends T>value - Representation valueCanonicalValueViolationpublic final org.opendaylight.yangtools.concepts.Variant<T,CanonicalValueViolation> validateRepresentation(T value, String canonicalString)
CanonicalValueValidatorCanonicalValue 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.validateRepresentation in interface CanonicalValueValidator<T extends DerivedString<T>,V extends T>value - Representation valuecanonicalString - Canonical string matching the representation valueCanonicalValueViolationprotected org.opendaylight.yangtools.concepts.Variant<T,CanonicalValueViolation> validate(T value)
DerivedString representation. Subclasses 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 valueNullPointerException - if value is nullprotected abstract org.opendaylight.yangtools.concepts.Variant<T,CanonicalValueViolation> validate(T value, String canonicalString)
DerivedString representation. Subclasses can chose whether they operate on representation
state or canonical string -- both are considered equivalent.value - Representation valuecanonicalString - Canonical string matching the representation valueNullPointerException - if value or canonicalString is null.Copyright © 2018 OpenDaylight. All rights reserved.