package kz.cafe.admin.panels;


public class Order implements java.io.Serializable{
   private static final long serialVersionUID = -1218073429835955996L;

   public static final short LESS = 0;
   public static final short CREATER = 1;

   public final short type;
   public final String field;
   public final String name;





   public Order(short type, String field, String name){
      this.type = type;
      this.field = field;
      this.name = name;
   }





   public String toMongo(){
      if(type == CREATER){
         return field;
      }
      else{
         return "-" + field;
      }
   }





   @Override
   public String toString(){
      StringBuilder builder = new StringBuilder();
      builder.append("Order [type=");
      builder.append(type);
      builder.append(", field=");
      builder.append(field);
      builder.append(", name=");
      builder.append(name);
      builder.append("]");
      return builder.toString();
   }
}
