String value = node.getValue();
String value = null; if ( node.getValue() instanceof String ) { value = ( String ) node.getValue(); } else if ( node.getValue() instanceof byte[] ) { value = "#" + StringTools.toHexString( ( byte[] ) node.getValue() ); } else { value = node.getValue().toString(); }
    public boolean evaluate( SimpleNode node, Attribute objectClasses ) throws NamingException    {        if ( node == null )        {            throw new IllegalArgumentException( "node cannot be null" );        }        if ( node.getAssertionType() != LeafNode.EQUALITY )        {            throw new NamingException( "Unrecognized assertion type for refinement node: " + node.getAssertionType() );        }        if ( !node.getAttribute().equalsIgnoreCase( "objectclass" ) )        {            throw new NamingException( "Refinement leaf node attribute was " + node.getAttribute() );        }        if ( null == objectClasses )        {            throw new IllegalArgumentException( "objectClasses argument cannot be null" );        }        if ( !objectClasses.getID().equalsIgnoreCase( "objectclass" ) )        {            throw new IllegalArgumentException( "objectClasses attribute must be for ID 'objectClass'" );        }        // check if AVA value exists in attribute        if ( objectClasses.contains( node.getValue() ) )        {            return true;        }        // If the filter value for the objectClass is an OID we need to resolve a name        String value = node.getValue();        if ( Character.isDigit( value.charAt( 0 ) ) )        {            Iterator list = registry.getNameSet( value ).iterator();            while ( list.hasNext() )            {                String objectClass = ( String ) list.next();                if ( objectClasses.contains( objectClass ) )                {                    return true;                }            }        }        // no match so return false        return false;    }