directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r1789872 - /directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DummySyntaxChecker.java
Date Sun, 02 Apr 2017 12:07:44 GMT
Author: seelmann
Date: Sun Apr  2 12:07:44 2017
New Revision: 1789872

URL: http://svn.apache.org/viewvc?rev=1789872&view=rev
Log:
Add builder to dummy syntax checker

Modified:
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DummySyntaxChecker.java

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DummySyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DummySyntaxChecker.java?rev=1789872&r1=1789871&r2=1789872&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DummySyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/api/ldap/model/schema/syntaxCheckers/DummySyntaxChecker.java
Sun Apr  2 12:07:44 2017
@@ -33,11 +33,38 @@ import org.apache.directory.api.ldap.mod
 public class DummySyntaxChecker extends SyntaxChecker
 {
     /**
-     * Creates a new instance of DummySyntaxChecker.
+     * A static Builder for this class
      */
-    public DummySyntaxChecker()
+    public static final class Builder extends SCBuilder<DummySyntaxChecker>
     {
-        super( SchemaConstants.OCTET_STRING_SYNTAX );
+
+        /**
+         * The Builder constructor
+         */
+        private Builder()
+        {
+            super( SchemaConstants.OCTET_STRING_SYNTAX );
+        }
+
+
+        /**
+         * Create a new instance of DummySyntaxChecker
+         * @return A new instance of DummySyntaxChecker
+         */
+        @Override
+        public DummySyntaxChecker build()
+        {
+            return new DummySyntaxChecker( oid );
+        }
+    }
+
+
+    /**
+     * @return An instance of the Builder for this class
+     */
+    public static Builder builder()
+    {
+        return new Builder();
     }
 
 
@@ -46,7 +73,7 @@ public class DummySyntaxChecker extends
      * 
      * @param oid The Syntax's OID 
      */
-    public DummySyntaxChecker( String oid )
+    private DummySyntaxChecker( String oid )
     {
         super( oid );
     }



Mime
View raw message