title: 6.35 - Value navPrev: 6.34-syntax-checker.html navPrevText: 6.34 - SyntaxChecker navUp: 6-ldap-data-structures.html navUpText: 6 - LDAP data structures navNext: 7-requests-responses.html navNextText: 7 - Requests and Responses

6.35 - Value

The Value class is used to store an attribute's value. Such a value can be either a String or a byte[], depending on the nature of the AttributeType (the default is that the Value is a String). Each value is associated to an AttributeType, and is used in an Entry or a DN.

We can create a schema aware Value, or just a plain Value. Having a schema aware Value allows further controls to be made on the value injected : its syntax will be checked against the AttributeType syntax.

Value is also a Externalizable class.

Value instances are immutable.

Creating a value

There are two ways to create a value:

  • using a constructor
  • using a static factory (useful for deserialization)

You can create the value passing it an AttributeType, or without it. Here are the possible constructors:

The third constructor is quite specific, as Value is immutable, and it allows you to associate a SchemaManager to a Value instance (creating a new Value in the process). The new Value instance will be schema aware.

Operations on a Value

There are ways to consult the content of the Value, and its status. Here is the list of common operations: