Skip to content

Commit 615a01b

Browse files
committed
DATACMNS-1591 - Polishing.
Add since tags. Reorder methods. Use method references where possible. Original pull request: #410.
1 parent e5fe9eb commit 615a01b

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

src/main/java/org/springframework/data/repository/config/DefaultRepositoryConfiguration.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public Optional<String> getRepositoryBaseClassName() {
161161
public String getRepositoryFactoryBeanClassName() {
162162

163163
return configurationSource.getRepositoryFactoryBeanClassName()
164-
.orElseGet(() -> extension.getRepositoryFactoryBeanClassName());
164+
.orElseGet(extension::getRepositoryFactoryBeanClassName);
165165
}
166166

167167
/*
@@ -173,6 +173,15 @@ public boolean isLazyInit() {
173173
return definition.isLazyInit() || !configurationSource.getBootstrapMode().equals(BootstrapMode.DEFAULT);
174174
}
175175

176+
/*
177+
* (non-Javadoc)
178+
* @see org.springframework.data.repository.config.RepositoryConfiguration#isPrimary()
179+
*/
180+
@Override
181+
public boolean isPrimary() {
182+
return definition.isPrimary();
183+
}
184+
176185
/*
177186
* (non-Javadoc)
178187
* @see org.springframework.data.repository.config.RepositoryConfiguration#getExcludeFilters()
@@ -205,13 +214,4 @@ public ImplementationLookupConfiguration toLookupConfiguration(MetadataReaderFac
205214

206215
return toImplementationDetectionConfiguration(factory).forRepositoryConfiguration(this);
207216
}
208-
209-
/*
210-
* (non-Javadoc)
211-
* @see org.springframework.data.repository.config.RepositoryConfiguration#isPrimary()
212-
*/
213-
@Override
214-
public boolean isPrimary() {
215-
return definition.isPrimary();
216-
}
217217
}

src/main/java/org/springframework/data/repository/config/RepositoryConfiguration.java

+8-6
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ public interface RepositoryConfiguration<T extends RepositoryConfigurationSource
106106
*/
107107
boolean isLazyInit();
108108

109+
/**
110+
* Returns whether the repository is the primary one for its type.
111+
*
112+
* @return {@literal true} whether the repository is the primary one for its type.
113+
* @since 2.2.1
114+
*/
115+
boolean isPrimary();
116+
109117
/**
110118
* Returns the {@link TypeFilter}s to be used to exclude packages from repository scanning.
111119
*
@@ -131,10 +139,4 @@ public interface RepositoryConfiguration<T extends RepositoryConfigurationSource
131139
*/
132140
ImplementationLookupConfiguration toLookupConfiguration(MetadataReaderFactory factory);
133141

134-
/**
135-
* Returns whether the repository is the primary one for its type.
136-
*
137-
* @return
138-
*/
139-
boolean isPrimary();
140142
}

0 commit comments

Comments
 (0)