All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jelastic.api.data.po.EnvsCriteria Maven / Gradle / Ivy

The newest version!
/*Server class MD5: 172c444d14ab11c8b4a86c7ccaa59560*/
package com.jelastic.api.data.po;

import com.jelastic.api.development.response.interfaces.ArrayItem;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * @name Jelastic API Client
 * @version 8.11.2
 * @copyright Jelastic, Inc.
 */
public class EnvsCriteria extends ArrayItem {

    private String orderField;

    private Order order = Order.ASC;

    private OrderType orderType = OrderType.NAME;

    @Override
    public JSONObject _toJSON() throws JSONException {
        JSONObject object = new JSONObject();
        object.put("orderField", orderField);
        object.put("order", order);
        return super._toJSON();
    }

    @Override
    public EnvsCriteria _fromJSON(JSONObject json) throws JSONException {
        if (json.has("orderField")) {
            orderField = json.getString("orderField");
        }
        if (json.has("order")) {
            order = Order.valueOf(json.getString("order").toUpperCase());
        }
        return this;
    }

    public String getOrderField() {
        return orderField;
    }

    public void setOrderField(String orderField) {
        this.orderField = orderField;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    public OrderType getOrderType() {
        return orderType;
    }

    public void setOrderType(OrderType orderType) {
        this.orderType = orderType;
    }

    public enum Order {

        ASC, DESC
    }

    public enum OrderType {

        NAME, STATUS
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy