Skip to content

Commit 587a0aa

Browse files
committed
Spotless clean up
1 parent 9b791d5 commit 587a0aa

File tree

67 files changed

+4419
-4294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4419
-4294
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
package io.github.atkawa7.httpsnippet.demo;
22

3-
import io.github.atkawa7.httpsnippet.demo.config.DemoConfig;
43
import org.springframework.boot.SpringApplication;
54
import org.springframework.boot.autoconfigure.SpringBootApplication;
65
import org.springframework.context.annotation.Import;
76

7+
import io.github.atkawa7.httpsnippet.demo.config.DemoConfig;
8+
89
@SpringBootApplication
910
@Import({DemoConfig.class})
1011
public class DemoStarter {
1112

12-
public static void main(String[] args) {
13-
SpringApplication.run(DemoStarter.class, args);
14-
}
13+
public static void main(String[] args) {
14+
SpringApplication.run(DemoStarter.class, args);
15+
}
1516
}
Lines changed: 70 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
package io.github.atkawa7.httpsnippet.demo.config;
22

3-
import io.github.atkawa7.httpsnippet.demo.domain.EntityMarker;
4-
import io.github.atkawa7.httpsnippet.demo.processors.SpeakerProcessor;
5-
import io.github.atkawa7.httpsnippet.demo.processors.SpeakerProcessorImpl;
6-
import io.github.atkawa7.httpsnippet.demo.repository.RepositoryMarker;
7-
import io.github.atkawa7.httpsnippet.demo.repository.SpeakerRepository;
8-
import io.github.atkawa7.httpsnippet.demo.resources.SpeakerResource;
9-
import io.github.atkawa7.httpsnippet.demo.service.SpeakerService;
10-
import io.github.atkawa7.httpsnippet.demo.service.SpeakerServiceImpl;
11-
import io.github.atkawa7.httpsnippet.demo.swagger.extensions.ExternalDocsVendorExtension;
12-
import io.github.atkawa7.httpsnippet.demo.swagger.extensions.LogoVendorExtension;
13-
import io.github.atkawa7.httpsnippet.demo.swagger.plugins.CodeSampleOperationBuilderPlugin;
14-
import io.github.atkawa7.httpsnippet.http.MediaType;
3+
import java.util.Collections;
4+
import java.util.HashSet;
5+
import java.util.List;
6+
import java.util.Set;
7+
158
import org.springframework.boot.autoconfigure.domain.EntityScan;
169
import org.springframework.context.annotation.Bean;
1710
import org.springframework.context.annotation.Configuration;
1811
import org.springframework.core.env.Environment;
1912
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
13+
2014
import springfox.documentation.builders.ApiInfoBuilder;
2115
import springfox.documentation.builders.PathSelectors;
2216
import springfox.documentation.builders.RequestHandlerSelectors;
@@ -28,73 +22,81 @@
2822
import springfox.documentation.spring.web.plugins.Docket;
2923
import springfox.documentation.swagger2.annotations.EnableSwagger2;
3024

31-
import java.util.Collections;
32-
import java.util.HashSet;
33-
import java.util.List;
34-
import java.util.Set;
25+
import io.github.atkawa7.httpsnippet.demo.domain.EntityMarker;
26+
import io.github.atkawa7.httpsnippet.demo.processors.SpeakerProcessor;
27+
import io.github.atkawa7.httpsnippet.demo.processors.SpeakerProcessorImpl;
28+
import io.github.atkawa7.httpsnippet.demo.repository.RepositoryMarker;
29+
import io.github.atkawa7.httpsnippet.demo.repository.SpeakerRepository;
30+
import io.github.atkawa7.httpsnippet.demo.resources.SpeakerResource;
31+
import io.github.atkawa7.httpsnippet.demo.service.SpeakerService;
32+
import io.github.atkawa7.httpsnippet.demo.service.SpeakerServiceImpl;
33+
import io.github.atkawa7.httpsnippet.demo.swagger.extensions.ExternalDocsVendorExtension;
34+
import io.github.atkawa7.httpsnippet.demo.swagger.extensions.LogoVendorExtension;
35+
import io.github.atkawa7.httpsnippet.demo.swagger.plugins.CodeSampleOperationBuilderPlugin;
36+
import io.github.atkawa7.httpsnippet.http.MediaType;
3537

3638
@Configuration
3739
@EntityScan(basePackageClasses = EntityMarker.class)
3840
@EnableJpaRepositories(basePackageClasses = RepositoryMarker.class)
3941
@EnableSwagger2
4042
public class DemoConfig {
41-
@Bean
42-
public DemoProperties demoProperties(Environment environment) {
43-
return new DemoProperties(environment);
44-
}
43+
@Bean
44+
public DemoProperties demoProperties(Environment environment) {
45+
return new DemoProperties(environment);
46+
}
4547

46-
@Bean
47-
public SpeakerService speakerService(SpeakerRepository speakerRepository) {
48-
return new SpeakerServiceImpl(speakerRepository);
49-
}
48+
@Bean
49+
public SpeakerService speakerService(SpeakerRepository speakerRepository) {
50+
return new SpeakerServiceImpl(speakerRepository);
51+
}
5052

51-
@Bean
52-
public SpeakerProcessor speakerProcessor(SpeakerService speakerService) {
53-
return new SpeakerProcessorImpl(speakerService);
54-
}
53+
@Bean
54+
public SpeakerProcessor speakerProcessor(SpeakerService speakerService) {
55+
return new SpeakerProcessorImpl(speakerService);
56+
}
5557

56-
@Bean
57-
public CodeSampleOperationBuilderPlugin codeSampleProcessor(DemoProperties demoProperties) {
58-
return new CodeSampleOperationBuilderPlugin(demoProperties);
59-
}
58+
@Bean
59+
public CodeSampleOperationBuilderPlugin codeSampleProcessor(DemoProperties demoProperties) {
60+
return new CodeSampleOperationBuilderPlugin(demoProperties);
61+
}
6062

61-
@Bean
62-
public Docket docket(DemoProperties demoProperties) {
63+
@Bean
64+
public Docket docket(DemoProperties demoProperties) {
6365

64-
Set<String> protocols = new HashSet<>(Collections.singleton("http"));
66+
Set<String> protocols = new HashSet<>(Collections.singleton("http"));
6567

66-
List<VendorExtension> apiInfoVendorExtensions =
67-
Collections.singletonList(
68-
new LogoVendorExtension(demoProperties).getObjectVendorExtension());
69-
List<VendorExtension> docketVendorExtensions =
70-
Collections.singletonList(
71-
new ExternalDocsVendorExtension(demoProperties).getObjectVendorExtension());
72-
ApiInfo apiInfo =
73-
new ApiInfoBuilder()
74-
.title(demoProperties.getApplicationName())
75-
.description(demoProperties.getApplicationDescription())
76-
.contact(
77-
new Contact(
78-
demoProperties.getApplicationName(),
79-
demoProperties.getApplicationDomain(),
80-
demoProperties.getApplicationSupport()))
81-
.license(demoProperties.getApplicationLicenseName())
82-
.licenseUrl(demoProperties.getApplicationLicenseUrl())
83-
.version(demoProperties.getApplicationVersion())
84-
.termsOfServiceUrl(demoProperties.getApplicationLicenseUrl())
85-
.extensions(apiInfoVendorExtensions)
86-
.build();
68+
List<VendorExtension> apiInfoVendorExtensions =
69+
Collections.singletonList(
70+
new LogoVendorExtension(demoProperties).getObjectVendorExtension());
71+
List<VendorExtension> docketVendorExtensions =
72+
Collections.singletonList(
73+
new ExternalDocsVendorExtension(demoProperties).getObjectVendorExtension());
74+
ApiInfo apiInfo =
75+
new ApiInfoBuilder()
76+
.title(demoProperties.getApplicationName())
77+
.description(demoProperties.getApplicationDescription())
78+
.contact(
79+
new Contact(
80+
demoProperties.getApplicationName(),
81+
demoProperties.getApplicationDomain(),
82+
demoProperties.getApplicationSupport()))
83+
.license(demoProperties.getApplicationLicenseName())
84+
.licenseUrl(demoProperties.getApplicationLicenseUrl())
85+
.version(demoProperties.getApplicationVersion())
86+
.termsOfServiceUrl(demoProperties.getApplicationLicenseUrl())
87+
.extensions(apiInfoVendorExtensions)
88+
.build();
8789

88-
return new Docket(DocumentationType.SWAGGER_2)
89-
.protocols(protocols)
90-
.apiInfo(apiInfo)
91-
.produces(Collections.singleton(MediaType.APPLICATION_JSON))
92-
.consumes(Collections.singleton(MediaType.APPLICATION_JSON))
93-
.extensions(docketVendorExtensions)
94-
.tags(new Tag("Speakers", "Speakers at Spring One Conference"))
95-
.select()
96-
.apis(RequestHandlerSelectors.basePackage(SpeakerResource.class.getPackage().getName()))
97-
.paths(PathSelectors.any())
98-
.build();
99-
}
90+
return new Docket(DocumentationType.SWAGGER_2)
91+
.protocols(protocols)
92+
.apiInfo(apiInfo)
93+
.produces(Collections.singleton(MediaType.APPLICATION_JSON))
94+
.consumes(Collections.singleton(MediaType.APPLICATION_JSON))
95+
.extensions(docketVendorExtensions)
96+
.tags(new Tag("Speakers", "Speakers at Spring One Conference"))
97+
.select()
98+
.apis(RequestHandlerSelectors.basePackage(SpeakerResource.class.getPackage().getName()))
99+
.paths(PathSelectors.any())
100+
.build();
101+
}
100102
}

httpsnippet-demo/src/main/java/io/github/atkawa7/httpsnippet/demo/config/DemoProperties.java

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,72 @@
44

55
public class DemoProperties {
66

7-
private static final String APPLICATION_EXTERNAL_DOCS_URL = "spring.application.externalDocs.url";
8-
private static final String APPLICATION_EXTERNAL_DOCS_DESCRIPTION =
9-
"spring.application.externalDocs.description";
10-
private static final String APPLICATION_BASE_URL = "spring.application.base-url";
11-
private static final String APPLICATION_LOGO_URL = "spring.application.logo.url";
12-
private static final String APPLICATION_LOGO_BACKGROUND_COLOR =
13-
"spring.application.logo.background-color";
14-
private static final String APPLICATION_NAME = "spring.application.name";
15-
private static final String APPLICATION_DESCRIPTION = "spring.application.description";
16-
private static final String APPLICATION_DOMAIN = "spring.application.domain";
17-
private static final String APPLICATION_SUPPORT = "spring.application.support";
18-
private static final String APPLICATION_VERSION = "spring.application.version";
19-
private static final String APPLICATION_LICENSE_NAME = "spring.application.license.name";
20-
private static final String APPLICATION_LICENSE_URL = "spring.application.license.url";
21-
22-
private final Environment environment;
23-
24-
public DemoProperties(Environment environment) {
25-
this.environment = environment;
26-
}
27-
28-
public String getApplicationBaseUrl() {
29-
return environment.getProperty(APPLICATION_BASE_URL);
30-
}
31-
32-
public String getApplicationExternalDocsUrl() {
33-
return environment.getProperty(APPLICATION_EXTERNAL_DOCS_URL);
34-
}
35-
36-
public String getApplicationExternalDocsDescription() {
37-
return environment.getProperty(APPLICATION_EXTERNAL_DOCS_DESCRIPTION);
38-
}
39-
40-
public String getApplicationLogoUrl() {
41-
return environment.getProperty(APPLICATION_LOGO_URL);
42-
}
43-
44-
public String getApplicationLogoBackgroundColor() {
45-
return environment.getProperty(APPLICATION_LOGO_BACKGROUND_COLOR);
46-
}
47-
48-
public String getApplicationName() {
49-
return environment.getProperty(APPLICATION_NAME);
50-
}
51-
52-
public String getApplicationDescription() {
53-
return environment.getProperty(APPLICATION_DESCRIPTION);
54-
}
55-
56-
public String getApplicationDomain() {
57-
return environment.getProperty(APPLICATION_DOMAIN);
58-
}
59-
60-
public String getApplicationSupport() {
61-
return environment.getProperty(APPLICATION_SUPPORT);
62-
}
63-
64-
public String getApplicationVersion() {
65-
return environment.getProperty(APPLICATION_VERSION);
66-
}
67-
68-
public String getApplicationLicenseName() {
69-
return environment.getProperty(APPLICATION_LICENSE_NAME);
70-
}
71-
72-
public String getApplicationLicenseUrl() {
73-
return environment.getProperty(APPLICATION_LICENSE_URL);
74-
}
7+
private static final String APPLICATION_EXTERNAL_DOCS_URL = "spring.application.externalDocs.url";
8+
private static final String APPLICATION_EXTERNAL_DOCS_DESCRIPTION =
9+
"spring.application.externalDocs.description";
10+
private static final String APPLICATION_BASE_URL = "spring.application.base-url";
11+
private static final String APPLICATION_LOGO_URL = "spring.application.logo.url";
12+
private static final String APPLICATION_LOGO_BACKGROUND_COLOR =
13+
"spring.application.logo.background-color";
14+
private static final String APPLICATION_NAME = "spring.application.name";
15+
private static final String APPLICATION_DESCRIPTION = "spring.application.description";
16+
private static final String APPLICATION_DOMAIN = "spring.application.domain";
17+
private static final String APPLICATION_SUPPORT = "spring.application.support";
18+
private static final String APPLICATION_VERSION = "spring.application.version";
19+
private static final String APPLICATION_LICENSE_NAME = "spring.application.license.name";
20+
private static final String APPLICATION_LICENSE_URL = "spring.application.license.url";
21+
22+
private final Environment environment;
23+
24+
public DemoProperties(Environment environment) {
25+
this.environment = environment;
26+
}
27+
28+
public String getApplicationBaseUrl() {
29+
return environment.getProperty(APPLICATION_BASE_URL);
30+
}
31+
32+
public String getApplicationExternalDocsUrl() {
33+
return environment.getProperty(APPLICATION_EXTERNAL_DOCS_URL);
34+
}
35+
36+
public String getApplicationExternalDocsDescription() {
37+
return environment.getProperty(APPLICATION_EXTERNAL_DOCS_DESCRIPTION);
38+
}
39+
40+
public String getApplicationLogoUrl() {
41+
return environment.getProperty(APPLICATION_LOGO_URL);
42+
}
43+
44+
public String getApplicationLogoBackgroundColor() {
45+
return environment.getProperty(APPLICATION_LOGO_BACKGROUND_COLOR);
46+
}
47+
48+
public String getApplicationName() {
49+
return environment.getProperty(APPLICATION_NAME);
50+
}
51+
52+
public String getApplicationDescription() {
53+
return environment.getProperty(APPLICATION_DESCRIPTION);
54+
}
55+
56+
public String getApplicationDomain() {
57+
return environment.getProperty(APPLICATION_DOMAIN);
58+
}
59+
60+
public String getApplicationSupport() {
61+
return environment.getProperty(APPLICATION_SUPPORT);
62+
}
63+
64+
public String getApplicationVersion() {
65+
return environment.getProperty(APPLICATION_VERSION);
66+
}
67+
68+
public String getApplicationLicenseName() {
69+
return environment.getProperty(APPLICATION_LICENSE_NAME);
70+
}
71+
72+
public String getApplicationLicenseUrl() {
73+
return environment.getProperty(APPLICATION_LICENSE_URL);
74+
}
7575
}

0 commit comments

Comments
 (0)