-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Add retrieval by ID when a service has a ServiceId annotation.
Example:
@ServiceDefinition(quantifier = Quantifier.MULTIPLE, batch = true)
public interface HashAlgorithm {
@ServiceId(pattern = ServiceId.SCREAMING_KEBAB_CASE)
String getName();
String hashToHex(byte[] input);
static void main(String[] args) {
// current code
HashAlgorithmLoader
.load()
.stream()
.filter(algo -> algo.getName().equals("SHA-256"))
.findFirst()
.ifPresent(algo -> System.out.println(algo.hashToHex("hello".getBytes(UTF_8))));
// initial retrieval code
new HashAlgorithmLoader()
.getById("SHA-256")
.ifPresent(algo -> System.out.println(algo.hashToHex("hello".getBytes(UTF_8))));
// additional retrieval code
HashAlgorithmLoader
.loadById("SHA-256")
.ifPresent(algo -> System.out.println(algo.hashToHex("hello".getBytes(UTF_8))));
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request