AutoRefactor'ed removing the 'final' keyword of 'static final' methods because 'final' keyword is implied by 'static' keyword.
| | |
| | | * @throws ClientException |
| | | * If an error occurs when reading the password. |
| | | */ |
| | | public static final char[] readPassword() throws ClientException { |
| | | public static char[] readPassword() throws ClientException { |
| | | try { |
| | | return System.console().readPassword(); |
| | | } catch (IOError e) { |
| | |
| | | super(out, err); |
| | | } |
| | | |
| | | static final MockConsoleApplication getDefault() { |
| | | static MockConsoleApplication getDefault() { |
| | | out = new ByteArrayOutputStream(); |
| | | final PrintStream psOut = new PrintStream(out); |
| | | err = new ByteArrayOutputStream(); |
| | |
| | | Element<C, S> { |
| | | |
| | | /** Factory method. */ |
| | | private static final <C extends ConfigurationClient, S extends Configuration> InstantiableElement<C, S> create( |
| | | private static <C extends ConfigurationClient, S extends Configuration> InstantiableElement<C, S> create( |
| | | InstantiableRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d, |
| | | String name) { |
| | | return new InstantiableElement<C, S>(r, d, name); |
| | |
| | | Element<C, S> { |
| | | |
| | | /** Factory method. */ |
| | | private static final <C extends ConfigurationClient, S extends Configuration> OptionalElement<C, S> create( |
| | | private static <C extends ConfigurationClient, S extends Configuration> OptionalElement<C, S> create( |
| | | OptionalRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d) { |
| | | return new OptionalElement<C, S>(r, d); |
| | | } |
| | |
| | | Element<C, S> { |
| | | |
| | | /** Factory method. */ |
| | | private static final <C extends ConfigurationClient, S extends Configuration> SetElement<C, S> create( |
| | | private static <C extends ConfigurationClient, S extends Configuration> SetElement<C, S> create( |
| | | SetRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d) { |
| | | return new SetElement<C, S>(r, d); |
| | | } |
| | |
| | | Element<C, S> { |
| | | |
| | | /** Factory method. */ |
| | | private static final <C extends ConfigurationClient, S extends Configuration> SingletonElement<C, S> create( |
| | | private static <C extends ConfigurationClient, S extends Configuration> SingletonElement<C, S> create( |
| | | SingletonRelationDefinition<? super C, ? super S> r, AbstractManagedObjectDefinition<C, S> d) { |
| | | return new SingletonElement<C, S>(r, d); |
| | | } |
| | |
| | | public interface Assertion { |
| | | |
| | | /** An assertion that always return UNDEFINED for matches and that creates a match all query. */ |
| | | public static final Assertion UNDEFINED_ASSERTION = new Assertion() { |
| | | Assertion UNDEFINED_ASSERTION = new Assertion() { |
| | | @Override |
| | | public ConditionResult matches(final ByteSequence normalizedAttributeValue) { |
| | | return ConditionResult.UNDEFINED; |
| | |
| | | * @throws NullPointerException |
| | | * If {@code attributeDescription} was {@code null}. |
| | | */ |
| | | public static final Attribute emptyAttribute(final AttributeDescription attributeDescription) { |
| | | public static Attribute emptyAttribute(final AttributeDescription attributeDescription) { |
| | | return new EmptyAttribute(attributeDescription); |
| | | } |
| | | |
| | |
| | | * @throws NullPointerException |
| | | * If {@code attributeDescription} was {@code null}. |
| | | */ |
| | | public static final Attribute emptyAttribute(final String attributeDescription) { |
| | | public static Attribute emptyAttribute(final String attributeDescription) { |
| | | return emptyAttribute(AttributeDescription.valueOf(attributeDescription)); |
| | | } |
| | | |
| | |
| | | * If {@code attribute} or {@code attributeDescription} was |
| | | * {@code null}. |
| | | */ |
| | | public static final Attribute renameAttribute(final Attribute attribute, |
| | | public static Attribute renameAttribute(final Attribute attribute, |
| | | final AttributeDescription attributeDescription) { |
| | | Reject.ifNull(attribute, attributeDescription); |
| | | |
| | |
| | | * If {@code attribute} or {@code attributeDescription} was |
| | | * {@code null}. |
| | | */ |
| | | public static final Attribute renameAttribute(final Attribute attribute, |
| | | final String attributeDescription) { |
| | | public static Attribute renameAttribute(final Attribute attribute, final String attributeDescription) { |
| | | Reject.ifNull(attribute, attributeDescription); |
| | | return renameAttribute(attribute, AttributeDescription.valueOf(attributeDescription)); |
| | | } |
| | |
| | | * If {@code attributeDescription} or {@code value} was |
| | | * {@code null}. |
| | | */ |
| | | public static final Attribute singletonAttribute( |
| | | final AttributeDescription attributeDescription, final Object value) { |
| | | public static Attribute singletonAttribute(final AttributeDescription attributeDescription, final Object value) { |
| | | return new SingletonAttribute(attributeDescription, value); |
| | | } |
| | | |
| | |
| | | * If {@code attributeDescription} or {@code value} was |
| | | * {@code null}. |
| | | */ |
| | | public static final Attribute singletonAttribute(final String attributeDescription, |
| | | final Object value) { |
| | | public static Attribute singletonAttribute(final String attributeDescription, final Object value) { |
| | | return singletonAttribute(AttributeDescription.valueOf(attributeDescription), value); |
| | | } |
| | | |
| | |
| | | * @throws NullPointerException |
| | | * If {@code attribute} was {@code null}. |
| | | */ |
| | | public static final Attribute unmodifiableAttribute(final Attribute attribute) { |
| | | public static Attribute unmodifiableAttribute(final Attribute attribute) { |
| | | if (attribute instanceof UnmodifiableAttribute) { |
| | | return attribute; |
| | | } else { |
| | | return new UnmodifiableAttribute(attribute); |
| | | } |
| | | return new UnmodifiableAttribute(attribute); |
| | | } |
| | | |
| | | /** Prevent instantiation. */ |
| | |
| | | * @throws NullPointerException |
| | | * If {@code sortKey} was {@code null}. |
| | | */ |
| | | public static final SortKey valueOf(String sortKey) { |
| | | public static SortKey valueOf(String sortKey) { |
| | | Reject.ifNull(sortKey); |
| | | |
| | | boolean reverseOrder = false; |
| | |
| | | * @throws NullPointerException |
| | | * If {@code authorizationName} was {@code null}. |
| | | */ |
| | | public static final ProxiedAuthV2RequestControl newControl(final String authorizationID) { |
| | | public static ProxiedAuthV2RequestControl newControl(final String authorizationID) { |
| | | if (authorizationID.length() == 0) { |
| | | // Anonymous. |
| | | return ANONYMOUS; |
| | |
| | | * If {@code fromEntry} or {@code toEntry} were {@code null}. |
| | | * @see Entries#diffEntries(Entry, Entry) |
| | | */ |
| | | public static final ModifyRequest newModifyRequest(final Entry fromEntry, final Entry toEntry) { |
| | | public static ModifyRequest newModifyRequest(final Entry fromEntry, final Entry toEntry) { |
| | | return Entries.diffEntries(fromEntry, toEntry); |
| | | } |
| | | |
| | |
| | | * |
| | | * @return an Entry with pre-defined attributes |
| | | */ |
| | | private static final Entry getStandardEntry() { |
| | | private static Entry getStandardEntry() { |
| | | final Entry entry = new LinkedHashMapEntry("cn=John Doe,ou=people,dc=example,dc=com"); |
| | | entry.addAttribute("objectClass", "top", "person", "inetOrgPerson"); |
| | | entry.addAttribute("cn", "John Doe"); |
| | |
| | | * |
| | | * @return The installation path. |
| | | */ |
| | | static final String getInstallationPath() { |
| | | static String getInstallationPath() { |
| | | return "/home/violette/OpenDJ-3.0.0/"; |
| | | } |
| | | |
| | |
| | | * |
| | | * @return The instance path. |
| | | */ |
| | | static final String getInstancePath() { |
| | | static String getInstancePath() { |
| | | return "/home/violette/OpenDJ-3.0.0/"; |
| | | } |
| | | |
| | |
| | | * |
| | | * @return the StaticLoggerBinder singleton |
| | | */ |
| | | public static final StaticLoggerBinder getSingleton() { |
| | | public static StaticLoggerBinder getSingleton() { |
| | | return SINGLETON; |
| | | } |
| | | |