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