Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
79 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
pac4j-core/src/main/java/org/pac4j/core/profile/creator/AbstractProfileCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.pac4j.core.profile.creator; | ||
|
||
import org.pac4j.core.credentials.Credentials; | ||
import org.pac4j.core.profile.CommonProfile; | ||
import org.pac4j.core.util.CommonHelper; | ||
import org.pac4j.core.util.InitializableWebObject; | ||
|
||
import java.util.function.Supplier; | ||
|
||
/** | ||
* Abstract profile creator where you can define the profile created. | ||
* | ||
* @author Jerome Leleu | ||
* @since 1.9.3 | ||
*/ | ||
public abstract class AbstractProfileCreator<C extends Credentials, P extends CommonProfile> extends InitializableWebObject implements ProfileCreator<C, P> { | ||
|
||
private Supplier<P> profileFactory; | ||
|
||
public Supplier<P> getProfileFactory() { | ||
return profileFactory; | ||
} | ||
|
||
public void setProfileFactory(final Supplier<P> profileFactory) { | ||
CommonHelper.assertNotNull("profileFactory", profileFactory); | ||
if (this.profileFactory == null) { | ||
this.profileFactory = profileFactory; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters