Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
fix: make FactoryLoader.java methods public (#489)
Browse files Browse the repository at this point in the history
Co-authored-by: g00563573 <L0kuj;lfyysq>
  • Loading branch information
olenagerasimova authored Jan 20, 2023
1 parent 5f0db2f commit d051bb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,30 @@ protected FactoryLoader(final Class<A> annot, final Map<String, String> env) {
* Default package name.
* @return The name of the default scan package
*/
abstract String defPackage();
public abstract String defPackage();

/**
* Environment parameter to define packages to find factories.
* Package names should be separated by semicolon ';'.
* @return Env param name
*/
abstract String scanPackagesEnv();
public abstract String scanPackagesEnv();

/**
* Find factory by name and create object.
* @param name The factory name
* @param config Configuration
* @return The object
*/
abstract O newObject(String name, C config);
public abstract O newObject(String name, C config);

/**
* Get the name of the factory from provided element. Call {@link Class#getAnnotations()}
* method on the element, filter required annotations and get factory implementation name.
* @param element Element to get annotations from
* @return The name of the factory
*/
abstract String getFactoryName(Class<?> element);
public abstract String getFactoryName(Class<?> element);

/**
* Finds and initiates annotated classes in default and env packages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public String scanPackagesEnv() {
}

@Override
String getFactoryName(final Class<?> element) {
public String getFactoryName(final Class<?> element) {
return Arrays.stream(element.getAnnotations())
.filter(ArtipieStorageFactory.class::isInstance)
.map(a -> ((ArtipieStorageFactory) a).value())
Expand Down

0 comments on commit d051bb5

Please sign in to comment.