mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
03.03.2013 56e752193bfb90d11cfe73c35a24e576b9b18c87
opends/src/server/org/opends/server/authorization/dseecompat/PermBindRulePair.java
@@ -23,8 +23,8 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2013 ForgeRock AS
 */
package org.opends.server.authorization.dseecompat;
/**
@@ -33,14 +33,10 @@
 */
public class PermBindRulePair {
    /*
     * The Bind Rule part.
     */
    /** The Bind Rule part. */
    private BindRule bindRule;
    /*
     * The permission part.
     */
    /** The permission part. */
    private Permission perm=null;
    /**
@@ -97,4 +93,30 @@
    public boolean hasRights(int right) {
        return perm.hasRights(right);
    }
    /** {@inheritDoc} */
    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        toString(sb);
        return sb.toString();
    }
    /**
     * Appends a string representation of this object to the provided buffer.
     *
     * @param buffer
     *          The buffer into which a string representation of this object
     *          should be appended.
     */
    public final void toString(StringBuilder buffer) {
        if (this.perm != null) {
            this.perm.toString(buffer);
        }
        buffer.append(" ");
        if (this.bindRule != null) {
            this.bindRule.toString(buffer);
        }
        buffer.append(")"); // not sure why, but we need this extra parenthesis
    }
}