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+
120package org .apache .cxf .jaxrs .swagger .ui ;
221
322import java .util .List ;
@@ -28,8 +47,8 @@ public void setClientId(String clientId) {
2847 this .clientId = clientId ;
2948 }
3049
31- public SwaggerUiOAuth2Config clientId (String clientId ) {
32- setClientId (clientId );
50+ public SwaggerUiOAuth2Config clientId (String cid ) {
51+ setClientId (cid );
3352 return this ;
3453 }
3554
@@ -41,8 +60,8 @@ public void setClientSecret(String clientSecret) {
4160 this .clientSecret = clientSecret ;
4261 }
4362
44- public SwaggerUiOAuth2Config clientSecret (String clientSecret ) {
45- setClientSecret (clientSecret );
63+ public SwaggerUiOAuth2Config clientSecret (String secret ) {
64+ setClientSecret (secret );
4665 return this ;
4766 }
4867
@@ -54,8 +73,8 @@ public void setRealm(String realm) {
5473 this .realm = realm ;
5574 }
5675
57- public SwaggerUiOAuth2Config realm (String realm ) {
58- setRealm (realm );
76+ public SwaggerUiOAuth2Config realm (String re ) {
77+ setRealm (re );
5978 return this ;
6079 }
6180
@@ -67,8 +86,8 @@ public void setAppName(String appName) {
6786 this .appName = appName ;
6887 }
6988
70- public SwaggerUiOAuth2Config appName (String appName ) {
71- setAppName (appName );
89+ public SwaggerUiOAuth2Config appName (String name ) {
90+ setAppName (name );
7291 return this ;
7392 }
7493
@@ -80,8 +99,8 @@ public void setScopes(List<String> scopes) {
8099 this .scopes = scopes ;
81100 }
82101
83- public SwaggerUiOAuth2Config scopes (List <String > scopes ) {
84- setScopes (scopes );
102+ public SwaggerUiOAuth2Config scopes (List <String > scopesList ) {
103+ setScopes (scopesList );
85104 return this ;
86105 }
87106
@@ -93,8 +112,8 @@ public void setAdditionalQueryStringParams(Map<String, String> additionalQuerySt
93112 this .additionalQueryStringParams = additionalQueryStringParams ;
94113 }
95114
96- public SwaggerUiOAuth2Config additionalQueryStringParams (Map <String , String > additionalQueryStringParams ) {
97- setAdditionalQueryStringParams (additionalQueryStringParams );
115+ public SwaggerUiOAuth2Config additionalQueryStringParams (Map <String , String > additionalParams ) {
116+ setAdditionalQueryStringParams (additionalParams );
98117 return this ;
99118 }
100119
@@ -106,8 +125,8 @@ public void setUseBasicAuthenticationWithAccessCodeGrant(Boolean useBasicAuthent
106125 this .useBasicAuthenticationWithAccessCodeGrant = useBasicAuthenticationWithAccessCodeGrant ;
107126 }
108127
109- public SwaggerUiOAuth2Config useBasicAuthenticationWithAccessCodeGrant (Boolean useBasicAuthenticationWithAccessCodeGrant ) {
110- setUseBasicAuthenticationWithAccessCodeGrant (useBasicAuthenticationWithAccessCodeGrant );
128+ public SwaggerUiOAuth2Config useBasicAuthenticationWithAccessCodeGrant (Boolean basicAuth ) {
129+ setUseBasicAuthenticationWithAccessCodeGrant (basicAuth );
111130 return this ;
112131 }
113132
@@ -119,8 +138,8 @@ public void setUsePkceWithAuthorizationCodeGrant(Boolean usePkceWithAuthorizatio
119138 this .usePkceWithAuthorizationCodeGrant = usePkceWithAuthorizationCodeGrant ;
120139 }
121140
122- public SwaggerUiOAuth2Config usePkceWithAuthorizationCodeGrant (Boolean usePkceWithAuthorizationCodeGrant ) {
123- setUsePkceWithAuthorizationCodeGrant (usePkceWithAuthorizationCodeGrant );
141+ public SwaggerUiOAuth2Config usePkceWithAuthorizationCodeGrant (Boolean pkce ) {
142+ setUsePkceWithAuthorizationCodeGrant (pkce );
124143 return this ;
125144 }
126145
@@ -143,18 +162,18 @@ public String toJsonString() {
143162 if (json .toString ().endsWith ("," )) {
144163 json .delete (json .length () - 1 , json .length ());
145164 }
146- return json .append ("}" ).toString ();
165+ return json .append ('}' ).toString ();
147166 }
148167
149168 private void addStringField (StringBuilder json , String name , String value ) {
150169 if (value != null ) {
151- json .append (quote (name )).append (':' ).append (quote (value )).append ("," );
170+ json .append (quote (name )).append (':' ).append (quote (value )).append (',' );
152171 }
153172 }
154173
155174 private void addBooleanField (StringBuilder json , String name , Boolean value ) {
156175 if (value != null ) {
157- json .append (quote (name )).append (':' ).append (quote ( value . toString ())) .append ("," );
176+ json .append (quote (name )).append (':' ).append (value ) .append (',' );
158177 }
159178 }
160179
@@ -163,7 +182,7 @@ private void addListField(StringBuilder json, String name, List<String> value) {
163182 json .append (quote (name )).append (':' ).append (
164183 value .stream ().map (this ::quote )
165184 .collect (Collectors .joining ("," , "[" , "]" ))
166- ).append ("," );
185+ ).append (',' );
167186 }
168187 }
169188
@@ -172,7 +191,7 @@ private void addMapField(StringBuilder json, String name, Map<String, String> va
172191 json .append (quote (name )).append (':' ).append (
173192 value .entrySet ().stream ().map (this ::entryToString )
174193 .collect (Collectors .joining ("," , "{" , "}" ))
175- ).append ("," );
194+ ).append (',' );
176195 }
177196 }
178197
0 commit comments