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 Variant<T,CanonicalValueViolation> |
validate(T value)
Validate a
DerivedString representation. |
protected abstract Variant<T,CanonicalValueViolation> |
validate(T value,
String canonicalString)
Validate a
DerivedString representation. |
Variant<T,CanonicalValueViolation> |
validateRepresentation(T value)
Validate a
CanonicalValue representation. |
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()
CanonicalValueValidator
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.getRepresentationClass
in interface CanonicalValueValidator<T extends DerivedString<T>,V extends T>
CanonicalValue
class.public final Class<V> getValidatedRepresentationClass()
CanonicalValueValidator
getValidatedRepresentationClass
in interface CanonicalValueValidator<T extends DerivedString<T>,V extends T>
public final Variant<T,CanonicalValueViolation> validateRepresentation(T value)
CanonicalValueValidator
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.validateRepresentation
in interface CanonicalValueValidator<T extends DerivedString<T>,V extends T>
value
- Representation valueCanonicalValueViolation
public final Variant<T,CanonicalValueViolation> validateRepresentation(T value, String canonicalString)
CanonicalValueValidator
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.validateRepresentation
in interface CanonicalValueValidator<T extends DerivedString<T>,V extends T>
value
- Representation valuecanonicalString
- Canonical string matching the representation valueCanonicalValueViolation
protected 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 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 © 2019 OpenDaylight. All rights reserved.