Interface ProfileFileSupplier
- All Superinterfaces:
Supplier<ProfileFile>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Encapsulates the logic for supplying either a single or multiple ProfileFile instances.
Each call to the Supplier.get() method will result in either a new or previously supplied profile based on the
implementation's rules.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ProfileFileSupplieraggregate(ProfileFileSupplier... suppliers) Creates aProfileFileSupplierby combining theProfileFileobjects from multipleProfileFileSuppliers.static ProfileFileSupplierCreates aProfileFileSuppliercapable of producing multiple profile objects by aggregating the default credentials and configuration files as determined byProfileFileLocation.credentialsFileLocation()abdProfileFileLocation.configurationFileLocation().static ProfileFileSupplierfixedProfileFile(ProfileFile profileFile) Creates aProfileFileSupplierthat produces an existing profile.static ProfileFileSupplierreloadWhenModified(Path path, ProfileFile.Type type) Creates aProfileFileSuppliercapable of producing multiple profile objects from a file.
-
Method Details
-
defaultSupplier
Creates aProfileFileSuppliercapable of producing multiple profile objects by aggregating the default credentials and configuration files as determined byProfileFileLocation.credentialsFileLocation()abdProfileFileLocation.configurationFileLocation(). This supplier will return a new ProfileFile instance only once either disk file has been modified. Multiple calls to the supplier while both disk files are unchanged will return the same object.- Returns:
- Implementation of
ProfileFileSupplierthat is capable of supplying a new aggregate profile when either file has been modified.
-
reloadWhenModified
Creates aProfileFileSuppliercapable of producing multiple profile objects from a file. This supplier will return a new ProfileFile instance only once the disk file has been modified. Multiple calls to the supplier while the disk file is unchanged will return the same object.- Parameters:
path- Path to the file to read from.type- The type of file. SeeProfileFile.Typefor possible values.- Returns:
- Implementation of
ProfileFileSupplierthat is capable of supplying a new profile when the file has been modified.
-
fixedProfileFile
Creates aProfileFileSupplierthat produces an existing profile.- Parameters:
profileFile- Profile object to supply.- Returns:
- Implementation of
ProfileFileSupplierthat is capable of supplying a single profile.
-
aggregate
Creates aProfileFileSupplierby combining theProfileFileobjects from multipleProfileFileSuppliers. Objects are passed intoProfileFile.Aggregator.- Parameters:
suppliers- Array ofProfileFileSupplierobjects.ProfileFileobjects are passed toProfileFile.Aggregator.addFile(ProfileFile)in the same argument order as the supplier that generated it.- Returns:
- Implementation of
ProfileFileSupplieraggregating results from the supplier objects.
-