public abstract class AbstractValue<T> extends Object implements Value<T>
Modifier and Type | Field and Description |
---|---|
protected AttributeType |
attributeType
reference to the attributeType zssociated with the value
|
protected int |
h
The computed hashcode.
|
protected static org.slf4j.Logger |
LOG
logger for reporting errors that might not be handled properly upstream
|
protected T |
normalizedValue
the canonical representation of the wrapped value
|
protected T |
wrappedValue
the wrapped binary value
|
Constructor and Description |
---|
AbstractValue() |
Modifier and Type | Method and Description |
---|---|
protected void |
apply(AttributeType attributeType)
Apply an AttributeType to the current Value, normalizing it.
|
Value<T> |
clone()
Clone a Value
|
AttributeType |
getAttributeType()
Get the associated AttributeType
|
byte[] |
getBytes()
Get the wrapped value as a byte[].
|
protected LdapComparator<T> |
getLdapComparator()
Gets a comparator using getMatchingRule() to resolve the matching
that the comparator is extracted from.
|
T |
getNormReference()
Gets a reference to the the normalized (canonical) representation
for the wrapped value.
|
T |
getReference()
Gets a reference to the wrapped value.
|
String |
getString()
Get the wrapped value as a String.
|
boolean |
isInstanceOf(AttributeType attributeType)
Check if the value is stored into an instance of the given
AttributeType, or one of its ascendant.
|
boolean |
isNull()
Check if the contained value is null or not
|
boolean |
isSchemaAware()
Tells if the value is schema aware or not.
|
boolean |
isValid(SyntaxChecker syntaxChecker)
Uses the syntaxChecker associated with the attributeType to check if the
value is valid.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNormValue, getValue, isHumanReadable, length
readExternal, writeExternal
compareTo
protected static final org.slf4j.Logger LOG
protected transient AttributeType attributeType
protected T wrappedValue
protected T normalizedValue
protected volatile int h
public AbstractValue()
public T getReference()
getReference
in interface Value<T>
public byte[] getBytes()
public AttributeType getAttributeType()
getAttributeType
in interface Value<T>
protected void apply(AttributeType attributeType) throws LdapInvalidAttributeValueException
attributeType
- The AttributeType to applyLdapInvalidAttributeValueException
- If the value is not valid accordingly
to the schemaprotected final LdapComparator<T> getLdapComparator() throws LdapException
LdapException
- if resolution of schema entities failpublic boolean isInstanceOf(AttributeType attributeType)
isInstanceOf
in interface Value<T>
attributeType
- The AttributeType we are looking attrue
if the value is associated with the given
attributeType or one of its ascendantpublic T getNormReference()
getNormReference
in interface Value<T>
public final boolean isNull()
public final boolean isValid(SyntaxChecker syntaxChecker) throws LdapInvalidAttributeValueException
isValid
in interface Value<T>
syntaxChecker
- the SyntaxChecker to use to validate the valuetrue
if the value is validLdapInvalidAttributeValueException
- if the value cannot be validatedpublic final boolean isSchemaAware()
isSchemaAware
in interface Value<T>
true
if the value is sxhema awareCopyright © 2003–2014 The Apache Software Foundation. All rights reserved.