001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.rest.server;
018
019import static org.apache.juneau.commons.utils.Shorts.*;
020
021import java.lang.annotation.*;
022
023import org.apache.juneau.commons.*;
024import org.apache.juneau.http.*;
025import org.apache.juneau.marshall.encoders.*;
026import org.apache.juneau.marshall.httppart.*;
027import org.apache.juneau.marshall.serializer.*;
028import org.apache.juneau.rest.server.arg.*;
029import org.apache.juneau.rest.server.auth.*;
030import org.apache.juneau.rest.server.converter.*;
031import org.apache.juneau.rest.server.guard.*;
032import org.apache.juneau.rest.server.openapi.*;
033import org.apache.juneau.rest.server.processor.*;
034import org.apache.juneau.rest.server.staticfile.*;
035import org.apache.juneau.rest.server.swagger.*;
036
037/**
038 * Utility classes and methods for the {@link Rest @Rest} annotation.
039 *
040 * <h2 class='section'>See Also:</h2><ul>
041 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/RestAnnotatedClasses">@Rest-Annotated Class</a>
042 * </ul>
043 */
044public class RestAnnotation {
045
046   /**
047    * Prevents instantiation.
048    */
049   private RestAnnotation() {}
050
051   /**
052    * Builder class.
053    *
054    * <h2 class='section'>See Also:</h2><ul>
055    *    <li class='jm'>{@link org.apache.juneau.marshall.MarshallingContext.Builder#annotations(Annotation...)}
056    * </ul>
057    */
058   @SuppressWarnings({
059      "unchecked" // Type erasure requires cast for Builder inheritance
060   })
061   public static class Builder extends AnnotationObject.Builder {
062
063      private String[] description = {};
064      private Class<? extends Encoder>[] encoders = new Class[0];
065      private Class<? extends HttpPartParser> partParser = HttpPartParser.Void.class;
066      private Class<? extends HttpPartSerializer> partSerializer = HttpPartSerializer.Void.class;
067      private Class<? extends StaticFiles> staticFiles = StaticFiles.Void.class;
068      private Class<? extends ResponseProcessor>[] responseProcessors = new Class[0];
069      private Class<? extends RestAuthenticator> authenticator = RestAuthenticator.Null.class;
070      private Class<? extends RestConverter>[] converters = new Class[0];
071      private Class<? extends RestGuard>[] guards = new Class[0];
072      private Class<? extends SwaggerProvider> swaggerProvider = SwaggerProvider.Void.class;
073      private Class<? extends OpenApiProvider> openApiProvider = OpenApiProvider.Void.class;
074      private Class<? extends RestOpArg>[] restOpArgs = new Class[0];
075      private Class<? extends Serializer>[] serializers = new Class[0];
076      private Class<?>[] children = {};
077      private Child[] childrenDefs = {};
078      private Class<?>[] mixins = {};
079      private Mixin[] mixinDefs = {};
080      private boolean mergeResponseProcessorsIntoHost;
081      private Class<?>[] parsers = {};
082      private Swagger swagger = SwaggerAnnotation.DEFAULT;
083      private String allowContentParam = "";
084      private String allowedHeaderParams = "";
085      private String allowedMethodHeaders = "";
086      private String allowedResponseHeaders = "";
087      private String allowCrossSite = "";
088      private String allowedOrigins = "";
089      private String allowedMethodParams = "";
090      private String clientVersionHeader = "";
091      private String config = "";
092      private String eagerInit = "";
093      private String lazyChildren = "";
094      private String defaultAccept = "";
095      private String defaultCharset = "";
096      private String defaultContentType = "";
097      private String maxInput = "";
098      private String messages = "";
099      private String path = "";
100      private String[] paths = {};
101      private String observability = "";
102      private String problemDetails = "";
103      private String debugMarshalling = "";
104      private String virtualThreads = "";
105      private String asyncTimeoutMillis = "";
106      private String asyncCompletionExecutor = "";
107      private String renderResponseStackTraces = "";
108      private String roleGuard = "";
109      private String rolesDeclared = "";
110      private String siteName = "";
111      private String uriAuthority = "";
112      private String uriContext = "";
113      private String uriRelativity = "";
114      private String uriResolution = "";
115      private String[] allowedParserOptions = {};
116      private String[] allowedSerializerOptions = {};
117      private String[] noInherit = {};
118      private String[] consumes = {};
119      private String[] defaultRequestAttributes = {};
120      private String[] defaultRequestHeaders = {};
121      private String[] defaultResponseHeaders = {};
122      private String[] produces = {};
123      private String[] title = {};
124      private final Query[] queryParams = new Query[0];
125      private final Header[] headerParams = new Header[0];
126      private final Path[] pathParams = new Path[0];
127      private final FormData[] formDataParams = new FormData[0];
128
129      /**
130       * Constructor.
131       */
132      protected Builder() {
133         super(Rest.class);
134      }
135
136      /**
137       * Sets the {@link Rest#allowedHeaderParams()} property on this annotation.
138       *
139       * @param value The new value for this property.
140       * @return This object.
141       */
142      public Builder allowedHeaderParams(String value) {
143         allowedHeaderParams = value;
144         return this;
145      }
146
147      /**
148       * Sets the {@link Rest#allowedMethodHeaders()} property on this annotation.
149       *
150       * @param value The new value for this property.
151       * @return This object.
152       */
153      public Builder allowedMethodHeaders(String value) {
154         allowedMethodHeaders = value;
155         return this;
156      }
157
158      /**
159       * Sets the {@link Rest#allowCrossSite()} property on this annotation.
160       *
161       * @param value The new value for this property.
162       * @return This object.
163       */
164      public Builder allowCrossSite(String value) {
165         allowCrossSite = value;
166         return this;
167      }
168
169      /**
170       * Sets the {@link Rest#allowedOrigins()} property on this annotation.
171       *
172       * @param value The new value for this property.
173       * @return This object.
174       */
175      public Builder allowedOrigins(String value) {
176         allowedOrigins = value;
177         return this;
178      }
179
180      /**
181       * Sets the {@link Rest#allowedResponseHeaders()} property on this annotation.
182       *
183       * @param value The new value for this property.
184       * @return This object.
185       */
186      public Builder allowedResponseHeaders(String value) {
187         allowedResponseHeaders = value;
188         return this;
189      }
190
191      /**
192       * Sets the {@link Rest#allowedMethodParams()} property on this annotation.
193       *
194       * @param value The new value for this property.
195       * @return This object.
196       */
197      public Builder allowedMethodParams(String value) {
198         allowedMethodParams = value;
199         return this;
200      }
201
202      /**
203       * Instantiates a new {@link Rest @Rest} object initialized with this builder.
204       *
205       * @return A new {@link Rest @Rest} object.
206       */
207      public Rest build() {
208         return new Object(this);
209      }
210
211      /**
212       * Sets the description property on this annotation.
213       *
214       * @param value The new value for this property.
215       * @return This object.
216       */
217      public Builder description(String...value) {
218         description = value;
219         return this;
220      }
221
222      /**
223       * Sets the {@link Rest#authenticator()} property on this annotation.
224       *
225       * @param value The new value for this property.
226       * @return This object.
227       */
228      public Builder authenticator(Class<? extends RestAuthenticator> value) {
229         authenticator = value;
230         return this;
231      }
232
233      /**
234       * Sets the {@link Rest#children()} property on this annotation.
235       *
236       * @param value The new value for this property.
237       * @return This object.
238       */
239      public Builder children(Class<?>...value) {
240         children = value;
241         return this;
242      }
243
244      /**
245       * Sets the {@link Rest#childrenDefs()} property on this annotation.
246       *
247       * @param value The new value for this property.
248       * @return This object.
249       */
250      public Builder childrenDefs(Child...value) {
251         childrenDefs = value;
252         return this;
253      }
254
255      /**
256       * Sets the {@link Rest#mixins()} property on this annotation.
257       *
258       * @param value The new value for this property.
259       * @return This object.
260       */
261      public Builder mixins(Class<?>...value) {
262         mixins = value;
263         return this;
264      }
265
266      /**
267       * Sets the {@link Rest#mixinDefs()} property on this annotation.
268       *
269       * @param value The new value for this property.
270       * @return This object.
271       */
272      public Builder mixinDefs(Mixin...value) {
273         mixinDefs = value;
274         return this;
275      }
276
277      /**
278       * Sets the {@link Rest#mergeResponseProcessorsIntoHost()} property on this annotation.
279       *
280       * @param value The new value for this property.
281       * @return This object.
282       */
283      public Builder mergeResponseProcessorsIntoHost(boolean value) {
284         mergeResponseProcessorsIntoHost = value;
285         return this;
286      }
287
288      /**
289       * Sets the {@link Rest#clientVersionHeader()} property on this annotation.
290       *
291       * @param value The new value for this property.
292       * @return This object.
293       */
294      public Builder clientVersionHeader(String value) {
295         clientVersionHeader = value;
296         return this;
297      }
298
299      /**
300       * Sets the {@link Rest#config()} property on this annotation.
301       *
302       * @param value The new value for this property.
303       * @return This object.
304       */
305      public Builder config(String value) {
306         config = value;
307         return this;
308      }
309
310      /**
311       * Sets the {@link Rest#eagerInit()} property on this annotation.
312       *
313       * @param value The new value for this property.
314       * @return This object.
315       */
316      public Builder eagerInit(String value) {
317         eagerInit = value;
318         return this;
319      }
320
321      /**
322       * Sets the {@link Rest#lazyChildren()} property on this annotation.
323       *
324       * @param value The new value for this property.
325       * @return This object.
326       */
327      public Builder lazyChildren(String value) {
328         lazyChildren = value;
329         return this;
330      }
331
332      /**
333       * Sets the {@link Rest#consumes()} property on this annotation.
334       *
335       * @param value The new value for this property.
336       * @return This object.
337       */
338      public Builder consumes(String...value) {
339         consumes = value;
340         return this;
341      }
342
343      /**
344       * Sets the {@link Rest#allowedSerializerOptions()} property on this annotation.
345       *
346       * @param value The new value for this property.
347       * @return This object.
348       */
349      public Builder allowedSerializerOptions(String...value) {
350         allowedSerializerOptions = value;
351         return this;
352      }
353
354      /**
355       * Sets the {@link Rest#allowedParserOptions()} property on this annotation.
356       *
357       * @param value The new value for this property.
358       * @return This object.
359       */
360      public Builder allowedParserOptions(String...value) {
361         allowedParserOptions = value;
362         return this;
363      }
364
365      /**
366       * Sets the {@link Rest#noInherit()} property on this annotation.
367       *
368       * @param value The new value for this property.
369       * @return This object.
370       */
371      public Builder noInherit(String...value) {
372         noInherit = value;
373         return this;
374      }
375
376      /**
377       * Sets the {@link Rest#converters()} property on this annotation.
378       *
379       * @param value The new value for this property.
380       * @return This object.
381       */
382      @SafeVarargs
383      public final Builder converters(Class<? extends RestConverter>...value) {
384         converters = value;
385         return this;
386      }
387
388      /**
389       * Sets the {@link Rest#defaultAccept()} property on this annotation.
390       *
391       * @param value The new value for this property.
392       * @return This object.
393       */
394      public Builder defaultAccept(String value) {
395         defaultAccept = value;
396         return this;
397      }
398
399      /**
400       * Sets the {@link Rest#defaultCharset()} property on this annotation.
401       *
402       * @param value The new value for this property.
403       * @return This object.
404       */
405      public Builder defaultCharset(String value) {
406         defaultCharset = value;
407         return this;
408      }
409
410      /**
411       * Sets the {@link Rest#defaultContentType()} property on this annotation.
412       *
413       * @param value The new value for this property.
414       * @return This object.
415       */
416      public Builder defaultContentType(String value) {
417         defaultContentType = value;
418         return this;
419      }
420
421      /**
422       * Sets the {@link Rest#defaultRequestAttributes()} property on this annotation.
423       *
424       * @param value The new value for this property.
425       * @return This object.
426       */
427      public Builder defaultRequestAttributes(String...value) {
428         defaultRequestAttributes = value;
429         return this;
430      }
431
432      /**
433       * Sets the {@link Rest#defaultRequestHeaders()} property on this annotation.
434       *
435       * @param value The new value for this property.
436       * @return This object.
437       */
438      public Builder defaultRequestHeaders(String...value) {
439         defaultRequestHeaders = value;
440         return this;
441      }
442
443      /**
444       * Sets the {@link Rest#defaultResponseHeaders()} property on this annotation.
445       *
446       * @param value The new value for this property.
447       * @return This object.
448       */
449      public Builder defaultResponseHeaders(String...value) {
450         defaultResponseHeaders = value;
451         return this;
452      }
453
454      /**
455       * Sets the {@link Rest#allowContentParam()} property on this annotation.
456       *
457       * @param value The new value for this property.
458       * @return This object.
459       */
460      public Builder allowContentParam(String value) {
461         allowContentParam = value;
462         return this;
463      }
464
465      /**
466       * Sets the {@link Rest#encoders()} property on this annotation.
467       *
468       * @param value The new value for this property.
469       * @return This object.
470       */
471      @SafeVarargs
472      public final Builder encoders(Class<? extends Encoder>...value) {
473         encoders = value;
474         return this;
475      }
476
477      /**
478       * Sets the {@link Rest#guards()} property on this annotation.
479       *
480       * @param value The new value for this property.
481       * @return This object.
482       */
483      @SafeVarargs
484      public final Builder guards(Class<? extends RestGuard>...value) {
485         guards = value;
486         return this;
487      }
488
489      /**
490       * Sets the {@link Rest#maxInput()} property on this annotation.
491       *
492       * @param value The new value for this property.
493       * @return This object.
494       */
495      public Builder maxInput(String value) {
496         maxInput = value;
497         return this;
498      }
499
500      /**
501       * Sets the {@link Rest#messages()} property on this annotation.
502       *
503       * @param value The new value for this property.
504       * @return This object.
505       */
506      public Builder messages(String value) {
507         messages = value;
508         return this;
509      }
510
511      /**
512       * Sets the {@link Rest#parsers()} property on this annotation.
513       *
514       * @param value The new value for this property.
515       * @return This object.
516       */
517      public Builder parsers(Class<?>...value) {
518         parsers = value;
519         return this;
520      }
521
522      /**
523       * Sets the {@link Rest#partParser()} property on this annotation.
524       *
525       * @param value The new value for this property.
526       * @return This object.
527       */
528      public Builder partParser(Class<? extends HttpPartParser> value) {
529         partParser = value;
530         return this;
531      }
532
533      /**
534       * Sets the {@link Rest#partSerializer()} property on this annotation.
535       *
536       * @param value The new value for this property.
537       * @return This object.
538       */
539      public Builder partSerializer(Class<? extends HttpPartSerializer> value) {
540         partSerializer = value;
541         return this;
542      }
543
544      /**
545       * Sets the {@link Rest#path()} property on this annotation.
546       *
547       * @param value The new value for this property.
548       * @return This object.
549       */
550      public Builder path(String value) {
551         path = value;
552         return this;
553      }
554
555      /**
556       * Sets the {@link Rest#paths()} property on this annotation.
557       *
558       * @param value The new value for this property.
559       * @return This object.
560       */
561      public Builder paths(String...value) {
562         paths = value;
563         return this;
564      }
565
566      /**
567       * Sets the {@link Rest#produces()} property on this annotation.
568       *
569       * @param value The new value for this property.
570       * @return This object.
571       */
572      public Builder produces(String...value) {
573         produces = value;
574         return this;
575      }
576
577      /**
578       * Sets the {@link Rest#problemDetails()} property on this annotation.
579       *
580       * @param value The new value for this property.
581       * @return This object.
582       */
583      public Builder problemDetails(String value) {
584         problemDetails = value;
585         return this;
586      }
587
588      /**
589       * Sets the {@link Rest#debugMarshalling()} property on this annotation.
590       *
591       * @param value The new value for this property.
592       * @return This object.
593       */
594      public Builder debugMarshalling(String value) {
595         debugMarshalling = value;
596         return this;
597      }
598
599      /**
600       * Sets the {@link Rest#observability()} property on this annotation.
601       *
602       * @param value The new value for this property.
603       * @return This object.
604       */
605      public Builder observability(String value) {
606         observability = value;
607         return this;
608      }
609
610      /**
611       * Sets the {@link Rest#virtualThreads()} property on this annotation.
612       *
613       * @param value The new value for this property.
614       * @return This object.
615       */
616      public Builder virtualThreads(String value) {
617         virtualThreads = value;
618         return this;
619      }
620
621      /**
622       * Sets the {@link Rest#asyncTimeoutMillis()} property on this annotation.
623       *
624       * @param value The new value for this property.
625       * @return This object.
626       */
627      public Builder asyncTimeoutMillis(String value) {
628         asyncTimeoutMillis = value;
629         return this;
630      }
631
632      /**
633       * Sets the {@link Rest#asyncCompletionExecutor()} property on this annotation.
634       *
635       * @param value The new value for this property.
636       * @return This object.
637       */
638      public Builder asyncCompletionExecutor(String value) {
639         asyncCompletionExecutor = value;
640         return this;
641      }
642
643      /**
644       * Sets the {@link Rest#renderResponseStackTraces()} property on this annotation.
645       *
646       * @param value The new value for this property.
647       * @return This object.
648       */
649      public Builder renderResponseStackTraces(String value) {
650         renderResponseStackTraces = value;
651         return this;
652      }
653
654      /**
655       * Sets the {@link Rest#responseProcessors()} property on this annotation.
656       *
657       * @param value The new value for this property.
658       * @return This object.
659       */
660      @SafeVarargs
661      public final Builder responseProcessors(Class<? extends ResponseProcessor>...value) {
662         responseProcessors = value;
663         return this;
664      }
665
666      /**
667       * Sets the {@link Rest#restOpArgs()} property on this annotation.
668       *
669       * @param value The new value for this property.
670       * @return This object.
671       */
672      @SafeVarargs
673      public final Builder restOpArgs(Class<? extends RestOpArg>...value) {
674         restOpArgs = value;
675         return this;
676      }
677
678      /**
679       * Sets the {@link Rest#roleGuard()} property on this annotation.
680       *
681       * @param value The new value for this property.
682       * @return This object.
683       */
684      public Builder roleGuard(String value) {
685         roleGuard = value;
686         return this;
687      }
688
689      /**
690       * Sets the {@link Rest#rolesDeclared()} property on this annotation.
691       *
692       * @param value The new value for this property.
693       * @return This object.
694       */
695      public Builder rolesDeclared(String value) {
696         rolesDeclared = value;
697         return this;
698      }
699
700      /**
701       * Sets the {@link Rest#serializers()} property on this annotation.
702       *
703       * @param value The new value for this property.
704       * @return This object.
705       */
706      @SafeVarargs
707      public final Builder serializers(Class<? extends Serializer>...value) {
708         serializers = value;
709         return this;
710      }
711
712      /**
713       * Sets the {@link Rest#siteName()} property on this annotation.
714       *
715       * @param value The new value for this property.
716       * @return This object.
717       */
718      public Builder siteName(String value) {
719         siteName = value;
720         return this;
721      }
722
723      /**
724       * Sets the {@link Rest#staticFiles()} property on this annotation.
725       *
726       * @param value The new value for this property.
727       * @return This object.
728       */
729      public Builder staticFiles(Class<? extends StaticFiles> value) {
730         staticFiles = value;
731         return this;
732      }
733
734      /**
735       * Sets the {@link Rest#swagger()} property on this annotation.
736       *
737       * @param value The new value for this property.
738       * @return This object.
739       */
740      public Builder swagger(Swagger value) {
741         swagger = value;
742         return this;
743      }
744
745      /**
746       * Sets the {@link Rest#swaggerProvider()} property on this annotation.
747       *
748       * @param value The new value for this property.
749       * @return This object.
750       */
751      public Builder swaggerProvider(Class<? extends SwaggerProvider> value) {
752         swaggerProvider = value;
753         return this;
754      }
755
756      /**
757       * Sets the {@link Rest#openApiProvider()} property on this annotation.
758       *
759       * @param value The new value for this property.
760       * @return This object.
761       */
762      public Builder openApiProvider(Class<? extends OpenApiProvider> value) {
763         openApiProvider = value;
764         return this;
765      }
766
767      /**
768       * Sets the {@link Rest#title()} property on this annotation.
769       *
770       * @param value The new value for this property.
771       * @return This object.
772       */
773      public Builder title(String...value) {
774         title = value;
775         return this;
776      }
777
778      /**
779       * Sets the {@link Rest#uriAuthority()} property on this annotation.
780       *
781       * @param value The new value for this property.
782       * @return This object.
783       */
784      public Builder uriAuthority(String value) {
785         uriAuthority = value;
786         return this;
787      }
788
789      /**
790       * Sets the {@link Rest#uriContext()} property on this annotation.
791       *
792       * @param value The new value for this property.
793       * @return This object.
794       */
795      public Builder uriContext(String value) {
796         uriContext = value;
797         return this;
798      }
799
800      /**
801       * Sets the {@link Rest#uriRelativity()} property on this annotation.
802       *
803       * @param value The new value for this property.
804       * @return This object.
805       */
806      public Builder uriRelativity(String value) {
807         uriRelativity = value;
808         return this;
809      }
810
811      /**
812       * Sets the {@link Rest#uriResolution()} property on this annotation.
813       *
814       * @param value The new value for this property.
815       * @return This object.
816       */
817      public Builder uriResolution(String value) {
818         uriResolution = value;
819         return this;
820      }
821
822   }
823
824   @SuppressWarnings({
825      "java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
826   })
827   private static class Object extends AnnotationObject implements Rest {
828
829      private final String[] description;
830      private final Class<? extends Encoder>[] encoders;
831      private final Class<? extends HttpPartParser> partParser;
832      private final Class<? extends HttpPartSerializer> partSerializer;
833      private final Class<? extends StaticFiles> staticFiles;
834      private final Class<? extends ResponseProcessor>[] responseProcessors;
835      private final Class<? extends RestAuthenticator> authenticator;
836      private final Class<? extends RestConverter>[] converters;
837      private final Class<? extends RestGuard>[] guards;
838      private final Class<? extends SwaggerProvider> swaggerProvider;
839      private final Class<? extends OpenApiProvider> openApiProvider;
840      private final Class<? extends RestOpArg>[] restOpArgs;
841      private final Class<? extends Serializer>[] serializers;
842      private final Class<?>[] children;
843      private final Child[] childrenDefs;
844      private final Class<?>[] mixins;
845      private final Mixin[] mixinDefs;
846      private final boolean mergeResponseProcessorsIntoHost;
847      private final Class<?>[] parsers;
848      private final Swagger swagger;
849      private final String allowContentParam;
850      private final String allowedHeaderParams;
851      private final String allowedMethodHeaders;
852      private final String allowedResponseHeaders;
853      private final String allowCrossSite;
854      private final String allowedOrigins;
855      private final String allowedMethodParams;
856      private final String clientVersionHeader;
857      private final String config;
858      private final String eagerInit;
859      private final String lazyChildren;
860      private final String defaultAccept;
861      private final String defaultCharset;
862      private final String defaultContentType;
863      private final String maxInput;
864      private final String messages;
865      private final String path;
866      private final String[] paths;
867      private final String observability;
868      private final String problemDetails;
869      private final String debugMarshalling;
870      private final String virtualThreads;
871      private final String asyncTimeoutMillis;
872      private final String asyncCompletionExecutor;
873      private final String renderResponseStackTraces;
874      private final String roleGuard;
875      private final String rolesDeclared;
876      private final String siteName;
877      private final String uriAuthority;
878      private final String uriContext;
879      private final String uriRelativity;
880      private final String uriResolution;
881      private final String[] allowedParserOptions;
882      private final String[] allowedSerializerOptions;
883      private final String[] noInherit;
884      private final String[] consumes;
885      private final String[] produces;
886      private final String[] defaultRequestAttributes;
887      private final String[] defaultRequestHeaders;
888      private final String[] defaultResponserHeaders;
889      private final String[] title;
890      private final Query[] queryParams;
891      private final Header[] headerParams;
892      private final Path[] pathParams;
893      private final FormData[] formDataParams;
894
895      Object(RestAnnotation.Builder b) {
896         super(b);
897         description = cp(b.description);
898         allowContentParam = b.allowContentParam;
899         allowedHeaderParams = b.allowedHeaderParams;
900         allowedMethodHeaders = b.allowedMethodHeaders;
901         allowedResponseHeaders = b.allowedResponseHeaders;
902         allowCrossSite = b.allowCrossSite;
903         allowedOrigins = b.allowedOrigins;
904         allowedMethodParams = b.allowedMethodParams;
905         authenticator = b.authenticator;
906         children = cp(b.children);
907         childrenDefs = cp(b.childrenDefs);
908         mixins = cp(b.mixins);
909         mixinDefs = cp(b.mixinDefs);
910         mergeResponseProcessorsIntoHost = b.mergeResponseProcessorsIntoHost;
911         clientVersionHeader = b.clientVersionHeader;
912         config = b.config;
913         eagerInit = b.eagerInit;
914         lazyChildren = b.lazyChildren;
915         allowedParserOptions = cp(b.allowedParserOptions);
916         allowedSerializerOptions = cp(b.allowedSerializerOptions);
917         noInherit = cp(b.noInherit);
918         consumes = cp(b.consumes);
919         converters = cp(b.converters);
920         defaultAccept = b.defaultAccept;
921         defaultCharset = b.defaultCharset;
922         defaultContentType = b.defaultContentType;
923         defaultRequestAttributes = cp(b.defaultRequestAttributes);
924         defaultRequestHeaders = cp(b.defaultRequestHeaders);
925         defaultResponserHeaders = cp(b.defaultResponseHeaders);
926         encoders = cp(b.encoders);
927         guards = cp(b.guards);
928         maxInput = b.maxInput;
929         messages = b.messages;
930         parsers = cp(b.parsers);
931         partParser = b.partParser;
932         partSerializer = b.partSerializer;
933         path = b.path;
934         paths = cp(b.paths);
935         observability = b.observability;
936         problemDetails = b.problemDetails;
937         debugMarshalling = b.debugMarshalling;
938         virtualThreads = b.virtualThreads;
939         asyncTimeoutMillis = b.asyncTimeoutMillis;
940         asyncCompletionExecutor = b.asyncCompletionExecutor;
941         produces = cp(b.produces);
942         renderResponseStackTraces = b.renderResponseStackTraces;
943         responseProcessors = cp(b.responseProcessors);
944         restOpArgs = cp(b.restOpArgs);
945         roleGuard = b.roleGuard;
946         rolesDeclared = b.rolesDeclared;
947         serializers = cp(b.serializers);
948         siteName = b.siteName;
949         staticFiles = b.staticFiles;
950         swagger = b.swagger;
951         swaggerProvider = b.swaggerProvider;
952         openApiProvider = b.openApiProvider;
953         title = cp(b.title);
954         uriAuthority = b.uriAuthority;
955         uriContext = b.uriContext;
956         uriRelativity = b.uriRelativity;
957         uriResolution = b.uriResolution;
958         queryParams = cp(b.queryParams);
959         headerParams = cp(b.headerParams);
960         pathParams = cp(b.pathParams);
961         formDataParams = cp(b.formDataParams);
962      }
963
964      @Override /* Overridden from Rest */
965      public String allowedHeaderParams() {
966         return allowedHeaderParams;
967      }
968
969      @Override /* Overridden from Rest */
970      public String allowedMethodHeaders() {
971         return allowedMethodHeaders;
972      }
973
974      @Override /* Overridden from Rest */
975      public String allowCrossSite() {
976         return allowCrossSite;
977      }
978
979      @Override /* Overridden from Rest */
980      public String allowedOrigins() {
981         return allowedOrigins;
982      }
983
984      @Override /* Overridden from Rest */
985      public String allowedResponseHeaders() {
986         return allowedResponseHeaders;
987      }
988
989      @Override /* Overridden from Rest */
990      public String allowedMethodParams() {
991         return allowedMethodParams;
992      }
993
994      @Override /* Overridden from Rest */
995      public Class<? extends RestAuthenticator> authenticator() {
996         return authenticator;
997      }
998
999      @Override /* Overridden from Rest */
1000      public Class<?>[] children() {
1001         return children;
1002      }
1003
1004      @Override /* Overridden from Rest */
1005      public Child[] childrenDefs() {
1006         return childrenDefs;
1007      }
1008
1009      @Override /* Overridden from Rest */
1010      public Class<?>[] mixins() {
1011         return mixins;
1012      }
1013
1014      @Override /* Overridden from Rest */
1015      public Mixin[] mixinDefs() {
1016         return mixinDefs;
1017      }
1018
1019      @Override /* Overridden from Rest */
1020      public boolean mergeResponseProcessorsIntoHost() {
1021         return mergeResponseProcessorsIntoHost;
1022      }
1023
1024      @Override /* Overridden from Rest */
1025      public String clientVersionHeader() {
1026         return clientVersionHeader;
1027      }
1028
1029      @Override /* Overridden from Rest */
1030      public String config() {
1031         return config;
1032      }
1033
1034      @Override /* Overridden from Rest */
1035      public String eagerInit() {
1036         return eagerInit;
1037      }
1038
1039      @Override /* Overridden from Rest */
1040      public String lazyChildren() {
1041         return lazyChildren;
1042      }
1043
1044      @Override /* Overridden from Rest */
1045      public String[] allowedParserOptions() {
1046         return allowedParserOptions;
1047      }
1048
1049      @Override /* Overridden from Rest */
1050      public String[] allowedSerializerOptions() {
1051         return allowedSerializerOptions;
1052      }
1053
1054      @Override /* Overridden from Rest */
1055      public String[] noInherit() {
1056         return noInherit;
1057      }
1058
1059      @Override /* Overridden from Rest */
1060      public String[] consumes() {
1061         return consumes;
1062      }
1063
1064      @Override /* Overridden from Rest */
1065      public Class<? extends RestConverter>[] converters() {
1066         return converters;
1067      }
1068
1069      @Override /* Overridden from Rest */
1070      public String defaultAccept() {
1071         return defaultAccept;
1072      }
1073
1074      @Override /* Overridden from Rest */
1075      public String defaultCharset() {
1076         return defaultCharset;
1077      }
1078
1079      @Override /* Overridden from Rest */
1080      public String defaultContentType() {
1081         return defaultContentType;
1082      }
1083
1084      @Override /* Overridden from Rest */
1085      public String[] defaultRequestAttributes() {
1086         return defaultRequestAttributes;
1087      }
1088
1089      @Override /* Overridden from Rest */
1090      public String[] defaultRequestHeaders() {
1091         return defaultRequestHeaders;
1092      }
1093
1094      @Override /* Overridden from Rest */
1095      public String[] defaultResponseHeaders() {
1096         return defaultResponserHeaders;
1097      }
1098
1099      @Override /* Overridden from Rest */
1100      public String allowContentParam() {
1101         return allowContentParam;
1102      }
1103
1104      @Override /* Overridden from Rest */
1105      public Class<? extends Encoder>[] encoders() {
1106         return encoders;
1107      }
1108
1109      @Override /* Overridden from Rest */
1110      public FormData[] formDataParams() {
1111         return formDataParams;
1112      }
1113
1114      @Override /* Overridden from Rest */
1115      public Class<? extends RestGuard>[] guards() {
1116         return guards;
1117      }
1118
1119      @Override /* Overridden from Rest */
1120      public Header[] headerParams() {
1121         return headerParams;
1122      }
1123
1124      @Override /* Overridden from Rest */
1125      public String maxInput() {
1126         return maxInput;
1127      }
1128
1129      @Override /* Overridden from Rest */
1130      public String messages() {
1131         return messages;
1132      }
1133
1134      @Override /* Overridden from Rest */
1135      public Class<?>[] parsers() {
1136         return parsers;
1137      }
1138
1139      @Override /* Overridden from Rest */
1140      public Class<? extends HttpPartParser> partParser() {
1141         return partParser;
1142      }
1143
1144      @Override /* Overridden from Rest */
1145      public Class<? extends HttpPartSerializer> partSerializer() {
1146         return partSerializer;
1147      }
1148
1149      @Override /* Overridden from Rest */
1150      public String path() {
1151         return path;
1152      }
1153
1154      @Override /* Overridden from Rest */
1155      public String[] paths() {
1156         return paths;
1157      }
1158
1159      @Override /* Overridden from Rest */
1160      public Path[] pathParams() {
1161         return pathParams;
1162      }
1163
1164      @Override /* Overridden from Rest */
1165      public String[] produces() {
1166         return produces;
1167      }
1168
1169      @Override /* Overridden from Rest */
1170      public Query[] queryParams() {
1171         return queryParams;
1172      }
1173
1174      @Override /* Overridden from Rest */
1175      public String observability() {
1176         return observability;
1177      }
1178
1179      @Override /* Overridden from Rest */
1180      public String problemDetails() {
1181         return problemDetails;
1182      }
1183
1184      @Override /* Overridden from Rest */
1185      public String debugMarshalling() {
1186         return debugMarshalling;
1187      }
1188
1189      @Override /* Overridden from Rest */
1190      public String virtualThreads() {
1191         return virtualThreads;
1192      }
1193
1194      @Override /* Overridden from Rest */
1195      public String asyncTimeoutMillis() {
1196         return asyncTimeoutMillis;
1197      }
1198
1199      @Override /* Overridden from Rest */
1200      public String asyncCompletionExecutor() {
1201         return asyncCompletionExecutor;
1202      }
1203
1204      @Override /* Overridden from Rest */
1205      public String renderResponseStackTraces() {
1206         return renderResponseStackTraces;
1207      }
1208
1209      @Override /* Overridden from Rest */
1210      public Class<? extends ResponseProcessor>[] responseProcessors() {
1211         return responseProcessors;
1212      }
1213
1214      @Override /* Overridden from Rest */
1215      public Class<? extends RestOpArg>[] restOpArgs() {
1216         return restOpArgs;
1217      }
1218
1219      @Override /* Overridden from Rest */
1220      public String roleGuard() {
1221         return roleGuard;
1222      }
1223
1224      @Override /* Overridden from Rest */
1225      public String rolesDeclared() {
1226         return rolesDeclared;
1227      }
1228
1229      @Override /* Overridden from Rest */
1230      public Class<? extends Serializer>[] serializers() {
1231         return serializers;
1232      }
1233
1234      @Override /* Overridden from Rest */
1235      public String siteName() {
1236         return siteName;
1237      }
1238
1239      @Override /* Overridden from Rest */
1240      public Class<? extends StaticFiles> staticFiles() {
1241         return staticFiles;
1242      }
1243
1244      @Override /* Overridden from Rest */
1245      public Swagger swagger() {
1246         return swagger;
1247      }
1248
1249      @Override /* Overridden from Rest */
1250      public Class<? extends SwaggerProvider> swaggerProvider() {
1251         return swaggerProvider;
1252      }
1253
1254      @Override /* Overridden from Rest */
1255      public Class<? extends OpenApiProvider> openApiProvider() {
1256         return openApiProvider;
1257      }
1258
1259      @Override /* Overridden from Rest */
1260      public String[] title() {
1261         return title;
1262      }
1263
1264      @Override /* Overridden from Rest */
1265      public String uriAuthority() {
1266         return uriAuthority;
1267      }
1268
1269      @Override /* Overridden from Rest */
1270      public String uriContext() {
1271         return uriContext;
1272      }
1273
1274      @Override /* Overridden from Rest */
1275      public String uriRelativity() {
1276         return uriRelativity;
1277      }
1278
1279      @Override /* Overridden from Rest */
1280      public String uriResolution() {
1281         return uriResolution;
1282      }
1283
1284      @Override /* Overridden from annotation */
1285      public String[] description() {
1286         return description;
1287      }
1288   }
1289
1290   /** Default value */
1291   public static final Rest DEFAULT = create().build();
1292
1293   /**
1294    * Instantiates a new builder for this class.
1295    *
1296    * @return A new builder object.
1297    */
1298   public static Builder create() {
1299      return new Builder();
1300   }
1301
1302}