// Path: rsql-api-parent/rsql-api-sort/src/main/java/com/github/vineey/rql/sort/SortBuilder.java
// public interface SortBuilder<T, E extends SortParam> {
//     T visit(SortNodeList node, E filterParam);
// }
// 
// Path: rsql-api-parent/rsql-api-sort/src/main/java/com/github/vineey/rql/sort/parser/ast/SortNode.java
// public class SortNode {
//     public enum Order {
//         ASC("+"),
//         DESC("-")
//         ;
//         private String symbol;
//         Order(String symbol){
//             this.symbol = symbol;
//         }
// 
//         public String getSymbol() {
//             return symbol;
//         }
// 
//         public static Order get(String orderSymbol) {
//             for(Order order : Order.values()){
//                 if(order.getSymbol().equals(orderSymbol)) {
//                     return order;
//                 }
//             }
//             throw new IllegalArgumentException("SortNode.Order has no matching enum value for symbol : ["+ orderSymbol +"}");
//         }
// 
//     }
// 
//     private String field;
//     private Order order;
// 
//     public String getField() {
//         return field;
//     }
// 
//     public SortNode setField(String field) {
//         this.field = field;
//         return this;
//     }
// 
//     public Order getOrder() {
//         return order;
//     }
// 
//     public SortNode setOrder(Order order) {
//         this.order = order;
//         return this;
//     }
// }
// 
// Path: rsql-api-parent/rsql-api-sort/src/main/java/com/github/vineey/rql/sort/parser/ast/SortNodeList.java
// public class SortNodeList {
//     private List<SortNode> nodes = new ArrayList<>();
// 
//     public void add(SortNode sortNode) {
//         this.nodes.add(sortNode);
//     }
// 
//     public List<SortNode> getNodes() {
//         return nodes;
//     }
// }


import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.github.vineey.rql.sort.SortBuilder;
import com.github.vineey.rql.sort.parser.ast.SortNode;
import com.github.vineey.rql.sort.parser.ast.SortNodeList;
import com.querydsl.core.types.Order;
import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.core.types.Path;
/*
* MIT License
* 
* Copyright (c) 2016 John Michael Vincent S. Rustia
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* 
*/
package com.github.vineey.rql.querydsl.sort;



/**
 * @author vrustia - 4/17/16.
 */
public class QuerydslSortBuilder implements SortBuilder<OrderSpecifierList, QuerydslSortParam> {
    @Override
// Path: rsql-api-parent/rsql-api-sort/src/main/java/com/github/vineey/rql/sort/SortBuilder.java
// public interface SortBuilder<T, E extends SortParam> {
//     T visit(SortNodeList node, E filterParam);
// }
// 
// Path: rsql-api-parent/rsql-api-sort/src/main/java/com/github/vineey/rql/sort/parser/ast/SortNode.java
// public class SortNode {
//     public enum Order {
//         ASC("+"),
//         DESC("-")
//         ;
//         private String symbol;
//         Order(String symbol){
//             this.symbol = symbol;
//         }
// 
//         public String getSymbol() {
//             return symbol;
//         }
// 
//         public static Order get(String orderSymbol) {
//             for(Order order : Order.values()){
//                 if(order.getSymbol().equals(orderSymbol)) {
//                     return order;
//                 }
//             }
//             throw new IllegalArgumentException("SortNode.Order has no matching enum value for symbol : ["+ orderSymbol +"}");
//         }
// 
//     }
// 
//     private String field;
//     private Order order;
// 
//     public String getField() {
//         return field;
//     }
// 
//     public SortNode setField(String field) {
//         this.field = field;
//         return this;
//     }
// 
//     public Order getOrder() {
//         return order;
//     }
// 
//     public SortNode setOrder(Order order) {
//         this.order = order;
//         return this;
//     }
// }
// 
// Path: rsql-api-parent/rsql-api-sort/src/main/java/com/github/vineey/rql/sort/parser/ast/SortNodeList.java
// public class SortNodeList {
//     private List<SortNode> nodes = new ArrayList<>();
// 
//     public void add(SortNode sortNode) {
//         this.nodes.add(sortNode);
//     }
// 
//     public List<SortNode> getNodes() {
//         return nodes;
//     }
// }


// Path: rsql-querydsl-parent/rsql-querydsl-sort/src/main/java/com/github/vineey/rql/querydsl/sort/QuerydslSortBuilder.java
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.github.vineey.rql.sort.SortBuilder;
import com.github.vineey.rql.sort.parser.ast.SortNode;
import com.github.vineey.rql.sort.parser.ast.SortNodeList;
import com.querydsl.core.types.Order;
import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.core.types.Path;

/*
* MIT License
* 
* Copyright (c) 2016 John Michael Vincent S. Rustia
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
* 
*/
package com.github.vineey.rql.querydsl.sort;



/**
 * @author vrustia - 4/17/16.
 */
public class QuerydslSortBuilder implements SortBuilder<OrderSpecifierList, QuerydslSortParam> {
    @Override
    public OrderSpecifierList visit(SortNodeList node, QuerydslSortParam filterParam) {