Unify method visibility of private classes

Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
This commit is contained in:
Phillip Webb
2019-07-01 12:29:51 -07:00
parent 0a02a3a19c
commit a66c4d3096
910 changed files with 3754 additions and 3945 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,15 +36,15 @@ class ConfigurationMetadataHint {
private final List<ValueProvider> valueProviders = new ArrayList<>();
public boolean isMapKeyHints() {
boolean isMapKeyHints() {
return (this.id != null && this.id.endsWith(KEY_SUFFIX));
}
public boolean isMapValueHints() {
boolean isMapValueHints() {
return (this.id != null && this.id.endsWith(VALUE_SUFFIX));
}
public String resolveId() {
String resolveId() {
if (isMapKeyHints()) {
return this.id.substring(0, this.id.length() - KEY_SUFFIX.length());
}
@@ -54,19 +54,19 @@ class ConfigurationMetadataHint {
return this.id;
}
public String getId() {
String getId() {
return this.id;
}
public void setId(String id) {
void setId(String id) {
this.id = id;
}
public List<ValueHint> getValueHints() {
List<ValueHint> getValueHints() {
return this.valueHints;
}
public List<ValueProvider> getValueProviders() {
List<ValueProvider> getValueProviders() {
return this.valueProviders;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,11 +34,11 @@ class ConfigurationMetadataItem extends ConfigurationMetadataProperty {
* attribute would contain the fully qualified name of that class.
* @return the source type
*/
public String getSourceType() {
String getSourceType() {
return this.sourceType;
}
public void setSourceType(String sourceType) {
void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
@@ -48,11 +48,11 @@ class ConfigurationMetadataItem extends ConfigurationMetadataProperty {
* {@code @ConfigurationProperties} annotated class.
* @return the source method
*/
public String getSourceMethod() {
String getSourceMethod() {
return this.sourceMethod;
}
public void setSourceMethod(String sourceMethod) {
void setSourceMethod(String sourceMethod) {
this.sourceMethod = sourceMethod;
}

View File

@@ -39,7 +39,7 @@ class JsonReader {
private final SentenceExtractor sentenceExtractor = new SentenceExtractor();
public RawConfigurationMetadata read(InputStream in, Charset charset) throws IOException {
RawConfigurationMetadata read(InputStream in, Charset charset) throws IOException {
try {
JSONObject json = readJson(in, charset);
List<ConfigurationMetadataSource> groups = parseAllSources(json);

View File

@@ -43,11 +43,11 @@ class RawConfigurationMetadata {
}
}
public List<ConfigurationMetadataSource> getSources() {
List<ConfigurationMetadataSource> getSources() {
return this.sources;
}
public ConfigurationMetadataSource getSource(ConfigurationMetadataItem item) {
ConfigurationMetadataSource getSource(ConfigurationMetadataItem item) {
if (item.getSourceType() == null) {
return null;
}
@@ -57,11 +57,11 @@ class RawConfigurationMetadata {
.max(Comparator.comparingInt((candidate) -> candidate.getGroupId().length())).orElse(null);
}
public List<ConfigurationMetadataItem> getItems() {
List<ConfigurationMetadataItem> getItems() {
return this.items;
}
public List<ConfigurationMetadataHint> getHints() {
List<ConfigurationMetadataHint> getHints() {
return this.hints;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ import java.util.stream.Collectors;
*/
class SentenceExtractor {
public String getFirstSentence(String text) {
String getFirstSentence(String text) {
if (text == null) {
return null;
}