protected static boolean isMatch(int code, String codePattern) {
        String scode = String.valueOf(code);
        byte [] c = scode.getBytes();
        byte [] cp = codePattern.getBytes();
        if (c.length != cp.length) {
            return false;
        }
        for (int idx = 0; idx < c.length; idx++) {
            byte cb = c[idx];
            byte cpb = cp[idx];
            if (cb != cpb && cpb != '*') {
                return false;
            }
        }
        return true;
    }
Returns true if the code matches the given pattern.
@param code
@param codePattern
plugins/circuit-breaker-policy/src/main/java/io/apiman/plugins/circuit_breaker/CircuitBreakerPolicy.java