Package com.unboundid.ldap.sdk.schema
Class NameFormDefinition
- java.lang.Object
-
- com.unboundid.ldap.sdk.schema.SchemaElement
-
- com.unboundid.ldap.sdk.schema.NameFormDefinition
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class NameFormDefinition extends SchemaElement
This class provides a data structure that describes an LDAP name form schema element.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NameFormDefinition(java.lang.String s)
Creates a new name form from the provided string representation.NameFormDefinition(java.lang.String oid, java.lang.String[] names, java.lang.String description, boolean isObsolete, java.lang.String structuralClass, java.lang.String[] requiredAttributes, java.lang.String[] optionalAttributes, java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new name form with the provided information.NameFormDefinition(java.lang.String oid, java.lang.String name, java.lang.String description, java.lang.String structuralClass, java.lang.String requiredAttribute, java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new name form with the provided information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Indicates whether the provided object is equal to this schema element.java.lang.String
getDescription()
Retrieves the description for this name form, if available.java.util.Map<java.lang.String,java.lang.String[]>
getExtensions()
Retrieves the set of extensions for this name form.java.lang.String
getNameOrOID()
Retrieves the primary name that can be used to reference this name form.java.lang.String[]
getNames()
Retrieves the set of names for this name form.java.lang.String
getOID()
Retrieves the OID for this name form.java.lang.String[]
getOptionalAttributes()
Retrieves the names or OIDs of the attributes that may optionally be present in the RDN of entries with the associated structural object class.java.lang.String[]
getRequiredAttributes()
Retrieves the names or OIDs of the attributes that are required to be present in the RDN of entries with the associated structural object class.SchemaElementType
getSchemaElementType()
Retrieves the type of schema element that this object represents.java.lang.String
getStructuralClass()
Retrieves the name or OID of the structural object class associated with this name form.int
hashCode()
Retrieves a hash code for this schema element.boolean
hasNameOrOID(java.lang.String s)
Indicates whether the provided string matches the OID or any of the names for this name form.boolean
isObsolete()
Indicates whether this name form is declared obsolete.java.lang.String
toString()
Retrieves a string representation of this name form definition, in the format described in RFC 4512 section 4.1.7.2.-
Methods inherited from class com.unboundid.ldap.sdk.schema.SchemaElement
allowEmptyDescription, extensionsEqual, setAllowEmptyDescription
-
-
-
-
Constructor Detail
-
NameFormDefinition
public NameFormDefinition(@NotNull java.lang.String s) throws LDAPException
Creates a new name form from the provided string representation.- Parameters:
s
- The string representation of the name form to create, using the syntax described in RFC 4512 section 4.1.7.2. It must not benull
.- Throws:
LDAPException
- If the provided string cannot be decoded as a name form definition.
-
NameFormDefinition
public NameFormDefinition(@NotNull java.lang.String oid, @Nullable java.lang.String name, @Nullable java.lang.String description, @NotNull java.lang.String structuralClass, @NotNull java.lang.String requiredAttribute, @NotNull java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new name form with the provided information.- Parameters:
oid
- The OID for this name form. It must not benull
.name
- The name for this name form. It may benull
or empty if the name form should only be referenced by OID.description
- The description for this name form. It may benull
if there is no description.structuralClass
- The name or OID of the structural object class with which this name form is associated. It must not benull
.requiredAttribute
- he name or OID of the attribute which must be present the RDN for entries with the associated structural class. It must not benull
.extensions
- The set of extensions for this name form. It may benull
or empty if there should not be any extensions.
-
NameFormDefinition
public NameFormDefinition(@NotNull java.lang.String oid, @Nullable java.lang.String[] names, @Nullable java.lang.String description, boolean isObsolete, @NotNull java.lang.String structuralClass, @NotNull java.lang.String[] requiredAttributes, @Nullable java.lang.String[] optionalAttributes, @Nullable java.util.Map<java.lang.String,java.lang.String[]> extensions)
Creates a new name form with the provided information.- Parameters:
oid
- The OID for this name form. It must not benull
.names
- The set of names for this name form. It may benull
or empty if the name form should only be referenced by OID.description
- The description for this name form. It may benull
if there is no description.isObsolete
- Indicates whether this name form is declared obsolete.structuralClass
- The name or OID of the structural object class with which this name form is associated. It must not benull
.requiredAttributes
- The names/OIDs of the attributes which must be present the RDN for entries with the associated structural class. It must not benull
or empty.optionalAttributes
- The names/OIDs of the attributes which may optionally be present in the RDN for entries with the associated structural class. It may benull
or empty if no optional attributes are needed.extensions
- The set of extensions for this name form. It may benull
or empty if there should not be any extensions.
-
-
Method Detail
-
getOID
@NotNull public java.lang.String getOID()
Retrieves the OID for this name form.- Returns:
- The OID for this name form.
-
getNames
@NotNull public java.lang.String[] getNames()
Retrieves the set of names for this name form.- Returns:
- The set of names for this name form, or an empty array if it does not have any names.
-
getNameOrOID
@NotNull public java.lang.String getNameOrOID()
Retrieves the primary name that can be used to reference this name form. If one or more names are defined, then the first name will be used. Otherwise, the OID will be returned.- Returns:
- The primary name that can be used to reference this name form.
-
hasNameOrOID
public boolean hasNameOrOID(@NotNull java.lang.String s)
Indicates whether the provided string matches the OID or any of the names for this name form.- Parameters:
s
- The string for which to make the determination. It must not benull
.- Returns:
true
if the provided string matches the OID or any of the names for this name form, orfalse
if not.
-
getDescription
@Nullable public java.lang.String getDescription()
Retrieves the description for this name form, if available.- Returns:
- The description for this name form, or
null
if there is no description defined.
-
isObsolete
public boolean isObsolete()
Indicates whether this name form is declared obsolete.- Returns:
true
if this name form is declared obsolete, orfalse
if it is not.
-
getStructuralClass
@NotNull public java.lang.String getStructuralClass()
Retrieves the name or OID of the structural object class associated with this name form.- Returns:
- The name or OID of the structural object class associated with this name form.
-
getRequiredAttributes
@NotNull public java.lang.String[] getRequiredAttributes()
Retrieves the names or OIDs of the attributes that are required to be present in the RDN of entries with the associated structural object class.- Returns:
- The names or OIDs of the attributes that are required to be present in the RDN of entries with the associated structural object class.
-
getOptionalAttributes
@NotNull public java.lang.String[] getOptionalAttributes()
Retrieves the names or OIDs of the attributes that may optionally be present in the RDN of entries with the associated structural object class.- Returns:
- The names or OIDs of the attributes that may optionally be present in the RDN of entries with the associated structural object class, or an empty array if there are no optional attributes.
-
getExtensions
@NotNull public java.util.Map<java.lang.String,java.lang.String[]> getExtensions()
Retrieves the set of extensions for this name form. They will be mapped from the extension name (which should start with "X-") to the set of values for that extension.- Returns:
- The set of extensions for this name form.
-
getSchemaElementType
@NotNull public SchemaElementType getSchemaElementType()
Retrieves the type of schema element that this object represents.- Specified by:
getSchemaElementType
in classSchemaElement
- Returns:
- The type of schema element that this object represents.
-
hashCode
public int hashCode()
Retrieves a hash code for this schema element.- Specified by:
hashCode
in classSchemaElement
- Returns:
- A hash code for this schema element.
-
equals
public boolean equals(@Nullable java.lang.Object o)
Indicates whether the provided object is equal to this schema element.- Specified by:
equals
in classSchemaElement
- Parameters:
o
- The object for which to make the determination.- Returns:
true
if the provided object may be considered equal to this schema element, orfalse
if not.
-
toString
@NotNull public java.lang.String toString()
Retrieves a string representation of this name form definition, in the format described in RFC 4512 section 4.1.7.2.- Specified by:
toString
in classSchemaElement
- Returns:
- A string representation of this name form definition.
-
-