2 * Copyright 2017-2018 Gregory Moyer and contributors.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.openhab.binding.lametrictime.api.cloud.model;
18 import java.util.List;
20 public class IconFilter
23 private Integer pageSize;
24 private List<IconField> fields;
25 private IconOrder order;
27 public Integer getPage()
32 public void setPage(Integer page)
37 public IconFilter withPage(Integer page)
43 public Integer getPageSize()
48 public void setPageSize(Integer pageSize)
50 this.pageSize = pageSize;
53 public IconFilter withPageSize(Integer pageSize)
55 this.pageSize = pageSize;
59 public List<IconField> getFields()
64 public String getFieldsString()
66 if (fields == null || fields.isEmpty())
71 StringBuilder builder = new StringBuilder();
72 builder.append(fields.get(0).name().toLowerCase());
74 for (int i = 1; i < fields.size(); i++)
76 builder.append(',').append(fields.get(i).name().toLowerCase());
79 return builder.toString();
82 public void setFields(List<IconField> fields)
87 public IconFilter withFields(List<IconField> fields)
93 public IconOrder getOrder()
98 public String getOrderString()
100 return order == null ? null : order.name().toLowerCase();
103 public void setOrder(IconOrder order)
108 public IconFilter withOrder(IconOrder order)