/*
 * Copyright © 2015 Stefan Niederhauser (nidin@gmx.ch)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package guru.nidi.codeassert.dependency;

/**
 * Define the dependency rules for a package and sub packages thereof.
 * A typical example looks as follows:
 * <pre>
 *     class OrgMyProject implements DependencyRuler {
 *         DependencyRule util, core_
 *
 *         public void defineRules() {
 *             base().mayUse(util, core_);
 *             util.mustNotUse(base(), core_);
 *         }
 *     }
 * </pre>
 * This class defines dependency rules for the package org.my.project.
 * All Fields of type DependencyRule refer to one or multiple packages:
 * <table summary="">
 * <tr>
 * <th>Field</th>
 * <th>Package</th>
 * </tr>
 * <tr>
 * <td>base()</td>
 * <td>org.my.project</td>
 * </tr>
 * <tr>
 * <td>util</td>
 * <td>org.my.project.util</td>
 * </tr>
 * <tr>
 * <td>core_</td>
 * <td>org.my.project.core and all sub packages</td>
 * </tr>
 * </table>
 * The method #defineRules defines upon which packages a package may, must or must not depend.
 */
public class DependencyRuler {
    DependencyRule unnamed;
    DependencyRule base;
    DependencyRule all;

    /**
     * @return the unnamed package (no package statement is used).
     */
    public DependencyRule unnamed() {
        return DependencyRules.addRuleToCurrent(unnamed);
    }

    /**
     * @return the package this DependencyRuler is defined for.
     */
    public DependencyRule base() {
        return DependencyRules.addRuleToCurrent(base);
    }

    /**
     * @return all packages inside this DependencyRuler.
     */
    public DependencyRule all() {
        return DependencyRules.addRuleToCurrent(all);
    }

    public void defineRules() {
    }
}

@@ -1707,25 +1707,17 @@
 %0A     * 
-@return t
+T
 he unnam
@@ -1728,16 +1728,21 @@
 ackage (
+when 
 no packa
@@ -1764,16 +1764,59 @@
  used).%0A
+     *%0A     * @return the unnamed package.%0A
      */%0A
@@ -1933,25 +1933,17 @@
 %0A     * 
-@return t
+T
 he packa
@@ -1982,16 +1982,69 @@
 ed for.%0A
+     *%0A     * @return the DependencyRuler's package.%0A
      */%0A
@@ -2159,17 +2159,9 @@
   * 
-@return a
+A
 ll p
@@ -2197,16 +2197,73 @@
 yRuler.%0A
+     *%0A     * @return all DependencyRuler's subpackages.%0A
      */%0A

fix checkstyle test