This - the type of this generic X.500 principal builder.public abstract class GenericX500PrincipalBuilder<This extends GenericX500PrincipalBuilder<This>> extends Object implements Builder<X500Principal>
X500Principal.
This abstract class is provided so that sub-classes can easily add methods
which return this without the need to cast its type by clients.
Example:
class MyBuilder extends GenericX500PrincipalBuilder<MyBuilder> {
MyBuilder addFOO(String value) {
addKeyword("FOO", "1.2.3.4.5.6.7.8.9");
return addAttribute("FOO", value);
}
}
class MyClient {
X500Principal create() {
return new MyBuilder()
.addAttribute("CN", "Duke")
.addFOO("a")
.build();
}
}
Notice that the call to addFOO is compilable because the previous
call to addAttribute is defined to return the generic type parameter
This.
| Constructor and Description |
|---|
GenericX500PrincipalBuilder() |
| Modifier and Type | Method and Description |
|---|---|
This |
addAttribute(String type,
String value)
Adds an X.500 attribute to the distinguished name.
|
This |
addAttribute(X500AttributeTypeKeyword keyword,
String value)
Adds an X.500 attribute to the distinguished name.
|
This |
addC(String value)
Equivalent to
addAttribute(. |
This |
addCN(String value)
Equivalent to
addAttribute(. |
This |
addDC(String value)
Equivalent to
addAttribute(. |
This |
addDNQ(String value)
Equivalent to
addAttribute(. |
This |
addDNQUALIFIER(String value)
Equivalent to
addAttribute(. |
This |
addEMAILADDRESS(String value)
Equivalent to
addAttribute(. |
This |
addGENERATION(String value)
Equivalent to
addAttribute(. |
This |
addGIVENNAME(String value)
Equivalent to
addAttribute(. |
This |
addINITIALS(String value)
Equivalent to
addAttribute(. |
This |
addKeyword(String keyword,
String oid)
Adds a mapping from a keyword to an Object Identifier (OID).
|
This |
addL(String value)
Equivalent to
addAttribute(. |
This |
addO(String value)
Equivalent to
addAttribute(. |
This |
addOU(String value)
Equivalent to
addAttribute(. |
This |
addSERIALNUMBER(String value)
Equivalent to
addAttribute(. |
This |
addST(String value)
Equivalent to
addAttribute(. |
This |
addSTREET(String value)
Equivalent to
addAttribute(. |
This |
addSURNAME(String value)
Equivalent to
addAttribute(. |
This |
addT(String value)
Equivalent to
addAttribute(. |
This |
addUID(String value)
Equivalent to
addAttribute(. |
X500Principal |
build()
Returns the X.500 principal with the distinguished name as built from
the sequence of attribute type and value pairs.
|
public This addAttribute(String type, @Nullable String value)
type - the attribute type,
which can be referenced by a keyword or its OID.value - the nullable, unquoted and unescaped attribute value.thisaddKeyword(java.lang.String, java.lang.String)public This addAttribute(X500AttributeTypeKeyword keyword, @Nullable String value)
keyword - the attribute type keyword.value - the nullable, unquoted and unescaped attribute value.thispublic This addDNQUALIFIER(@Nullable String value)
addAttribute(DNQUALIFIER, value).public This addEMAILADDRESS(@Nullable String value)
addAttribute(EMAILADDRESS, value).public This addGENERATION(@Nullable String value)
addAttribute(GENERATION, value).public This addGIVENNAME(@Nullable String value)
addAttribute(GIVENNAME, value).public This addINITIALS(@Nullable String value)
addAttribute(INITIALS, value).public This addKeyword(String keyword, @Nullable String oid)
keyword - the attribute type keyword.oid - the nullable OID.thispublic This addSERIALNUMBER(@Nullable String value)
addAttribute(SERIALNUMBER, value).public This addSURNAME(@Nullable String value)
addAttribute(SURNAME, value).public X500Principal build()
build in interface Builder<X500Principal>IllegalArgumentException - if an attribute type is unknown or its
keyword mapping is invalid.Copyright © 2005–2017 Schlichtherle IT Services. All rights reserved.