Android Open Source - TwelveRules Order






From Project

Back to project page TwelveRules.

License

The source code is released under:

Apache License

If you think the Android project TwelveRules listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.manuelpeinado.sql_dsl;
/*from  ww w.ja  v a2s  .  c o  m*/
import static com.manuelpeinado.sql_dsl.Constants.SPACE;

public class Order {
    private final Field expression;
    private final OrderType orderType;
    private final boolean collate;

    private Order(Field expression) {
        this(expression, OrderType.ASC);
    }

    private Order(Field expression, OrderType orderType) {
      this(expression, orderType, false);
    }
    
    private Order(Field expression, OrderType orderType, boolean collate) {
        this.expression = expression;
        this.orderType = orderType;
        this.collate = collate;
    }

    public static Order asc(Field expression) {
        return new Order(expression);
    }

    public static Order asc(Field expression, boolean collate) {
        return new Order(expression, OrderType.ASC, collate);
    }

    public static Order desc(Field expression) {
        return new Order(expression, OrderType.DESC);
    }

    public static Order desc(Field expression, boolean collate) {
        return new Order(expression, OrderType.DESC, collate);
    }

    @Override
    public String toString() {
        return expression + SPACE + (collate ? "COLLATE UNICODE " : "") + orderType;
    }
}




Java Source Code List

com.manuelpeinado.sql_dsl.Constants.java
com.manuelpeinado.sql_dsl.Criterion.java
com.manuelpeinado.sql_dsl.DBObject.java
com.manuelpeinado.sql_dsl.Field.java
com.manuelpeinado.sql_dsl.GroupBy.java
com.manuelpeinado.sql_dsl.JoinType.java
com.manuelpeinado.sql_dsl.Join.java
com.manuelpeinado.sql_dsl.Operator.java
com.manuelpeinado.sql_dsl.OrderType.java
com.manuelpeinado.sql_dsl.Order.java
com.manuelpeinado.sql_dsl.Query.java
com.manuelpeinado.sql_dsl.Table.java
com.manuelpeinado.sql_dsl.UnaryCriterion.java
com.manuelpeinado.twelverules.AssetsDatabase.java
com.manuelpeinado.twelverules.ColumnSet.java
com.manuelpeinado.twelverules.ContentValuesCreator.java
com.manuelpeinado.twelverules.DatabaseColumn.java
com.manuelpeinado.twelverules.DatabaseTable.java
com.manuelpeinado.twelverules.Database.java
com.manuelpeinado.twelverules.DbUtils.java
com.manuelpeinado.twelverules.IDatabase.java