// Path: src/main/java/me/legrange/mikrotik/MikrotikApiException.java
// public class MikrotikApiException extends Exception {
// 
// 
//     /** 
//      * Create a new exception 
//      * @param msg The message
//      */
//     public MikrotikApiException(String msg) {
//         super(msg);
//     }
// 
//  
//     /** 
//      * Create a new exception 
//      * @param msg The message
//      * @param err The underlying cause 
//      */
//     public MikrotikApiException(String msg, Throwable err) {
//         super(msg, err);
//     }
// }


import me.legrange.mikrotik.MikrotikApiException;
import java.util.List;
import java.util.Map;
package examples;



/**
 * Example 2: A command that returns results. Print all interfaces
 *
 * @author gideon
 */
public class NestedExpressions extends Example {

    public static void main(String... args) throws Exception {
        NestedExpressions ex = new NestedExpressions();
        ex.connect();
        ex.test("/ip/firewall/nat/print where (src-address=\"192.168.15.52\" or src-address=\"192.168.15.53\")");
        ex.test("/ip/firewall/nat/print where chain=api_test and (src-address=192.168.15.52) and action=log ");
        ex.test("/ip/firewall/nat/print where chain=api_test and (src-address=192.168.15.53 or src-address=192.168.15.52) and action=log ");
        ex.test("/ip/firewall/nat/print where chain=api_test and (src-address=\"192.168.15.53\" or src-address=\"192.168.15.52\") and action=log ");
        ex.disconnect();
    }

// Path: src/main/java/me/legrange/mikrotik/MikrotikApiException.java
// public class MikrotikApiException extends Exception {
// 
// 
//     /** 
//      * Create a new exception 
//      * @param msg The message
//      */
//     public MikrotikApiException(String msg) {
//         super(msg);
//     }
// 
//  
//     /** 
//      * Create a new exception 
//      * @param msg The message
//      * @param err The underlying cause 
//      */
//     public MikrotikApiException(String msg, Throwable err) {
//         super(msg, err);
//     }
// }


// Path: src/main/java/examples/NestedExpressions.java
import me.legrange.mikrotik.MikrotikApiException;
import java.util.List;
import java.util.Map;

package examples;



/**
 * Example 2: A command that returns results. Print all interfaces
 *
 * @author gideon
 */
public class NestedExpressions extends Example {

    public static void main(String... args) throws Exception {
        NestedExpressions ex = new NestedExpressions();
        ex.connect();
        ex.test("/ip/firewall/nat/print where (src-address=\"192.168.15.52\" or src-address=\"192.168.15.53\")");
        ex.test("/ip/firewall/nat/print where chain=api_test and (src-address=192.168.15.52) and action=log ");
        ex.test("/ip/firewall/nat/print where chain=api_test and (src-address=192.168.15.53 or src-address=192.168.15.52) and action=log ");
        ex.test("/ip/firewall/nat/print where chain=api_test and (src-address=\"192.168.15.53\" or src-address=\"192.168.15.52\") and action=log ");
        ex.disconnect();
    }

    private void test(String cmd) throws MikrotikApiException {