protected int complete(CommandContext ctx, ParsedCommandLine parsedCmd, OperationCandidatesProvider candidatesProvider, final String buffer, int cursor, List<String> candidates) {

        if(parsedCmd.isRequestComplete()) {
            return -1;
        }

        // Headers completion
        if(parsedCmd.endsOnHeaderListStart() || parsedCmd.hasHeaders()) {
            return completeHeaders(ctx, parsedCmd, candidatesProvider, buffer, cursor, candidates);
        }

        // Completed.
        if(parsedCmd.endsOnPropertyListEnd()) {
            return buffer.length();
        }

        // Complete properties
        if (parsedCmd.hasProperties() || parsedCmd.endsOnPropertyListStart()
                || parsedCmd.endsOnNotOperator()) {
            return completeProperties(ctx, parsedCmd, candidatesProvider, buffer, candidates);
        }

        // Complete Operation name
        if (parsedCmd.hasOperationName() || parsedCmd.endsOnAddressOperationNameSeparator()) {
            return completeOperationName(ctx, parsedCmd, candidatesProvider, buffer, candidates);
        }

        // Finally Complete address
        return completeAddress(ctx, parsedCmd, candidatesProvider, buffer, candidates);
    }
protected int complete ( CommandContext ctx , ParsedCommandLine parsedCmd , OperationCandidatesProvider candidatesProvider , final String buffer , int cursor , List < String > candidates ) { if ( parsedCmd . isRequestComplete ( ) ) { return - 1 ; } if ( parsedCmd . endsOnHeaderListStart ( ) || parsedCmd . hasHeaders ( ) ) { return completeHeaders ( ctx , parsedCmd , candidatesProvider , buffer , cursor , candidates ) ; } if ( parsedCmd . endsOnPropertyListEnd ( ) ) { return buffer . length ( ) ; } if ( parsedCmd . hasProperties ( ) || parsedCmd . endsOnPropertyListStart ( ) || parsedCmd . endsOnNotOperator ( ) ) { return completeProperties ( ctx , parsedCmd , candidatesProvider , buffer , candidates ) ; } if ( parsedCmd . hasOperationName ( ) || parsedCmd . endsOnAddressOperationNameSeparator ( ) ) { return completeOperationName ( ctx , parsedCmd , candidatesProvider , buffer , candidates ) ; } return completeAddress ( ctx , parsedCmd , candidatesProvider , buffer , candidates ) ; }
Complete both operations and commands.