View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.common.rest.api.beans;
20  
21  import io.swagger.v3.oas.annotations.Parameter;
22  import io.swagger.v3.oas.annotations.enums.ParameterIn;
23  import io.swagger.v3.oas.annotations.media.Schema;
24  import java.time.OffsetDateTime;
25  import javax.ws.rs.QueryParam;
26  
27  public class U2FDeviceQuery extends AbstractQuery {
28  
29      private static final long serialVersionUID = -7381828286332101171L;
30  
31      public static class Builder extends AbstractQuery.Builder<U2FDeviceQuery, U2FDeviceQuery.Builder> {
32  
33          @Override
34          protected U2FDeviceQuery newInstance() {
35              return new U2FDeviceQuery();
36          }
37  
38          public U2FDeviceQuery.Builder owner(final String owner) {
39              getInstance().setOwner(owner);
40              return this;
41          }
42  
43          public U2FDeviceQuery.Builder id(final Long id) {
44              getInstance().setId(id);
45              return this;
46          }
47  
48          public U2FDeviceQuery.Builder expirationDate(final OffsetDateTime date) {
49              getInstance().setExpirationDate(date);
50              return this;
51          }
52      }
53  
54      private Long id;
55  
56      private OffsetDateTime expirationDate;
57  
58      private String owner;
59  
60      @Parameter(name = "id", in = ParameterIn.QUERY, schema =
61              @Schema(implementation = Long.class))
62      public Long getId() {
63          return id;
64      }
65  
66      @QueryParam("id")
67      public void setId(final Long id) {
68          this.id = id;
69      }
70  
71      @Parameter(name = "expirationDate", in = ParameterIn.QUERY, schema =
72              @Schema(implementation = OffsetDateTime.class))
73      public OffsetDateTime getExpirationDate() {
74          return expirationDate;
75      }
76  
77      @QueryParam("expirationDate")
78      public void setExpirationDate(final OffsetDateTime expirationDate) {
79          this.expirationDate = expirationDate;
80      }
81  
82      @Parameter(name = "owner", in = ParameterIn.QUERY, schema =
83              @Schema(implementation = String.class))
84      public String getOwner() {
85          return owner;
86      }
87  
88      @QueryParam("owner")
89      public void setOwner(final String owner) {
90          this.owner = owner;
91      }
92  }