We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to filter providers using a system property.
Examples:
javax.net.ssl.trustStoreType=Windows-ROOT
jdk.tls.disabledAlgorithms=SSLv3, RC4
https.cipherSuites=SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA,SSL_DHE_DSS_WITH_DES_CBC_SHA
The following code ...
@ServiceDefinition(quantifier = Quantifier.MULTIPLE) public interface Translator { String translate(String text); String getName(); @ServiceFilter default boolean isEnabled() { return FILTER_ON_PROPERTY.apply(getName()); } static Predicate<String> FILTER_ON_PROPERTY = getFilter("translators", ',', true, true, false); } static Predicate<String> getFilter(String key, char separator, boolean onMatch, boolean onMiss, boolean caseSensitive) { String property = System.getProperty(key); if (property == null) return value -> onMiss; String[] values = property.split(String.valueOf(separator), -1); return value -> Stream.of(values).anyMatch(caseSensitive ? value::equals : value::equalsIgnoreCase) ^ onMatch; }
... could be simplified as :
@ServiceDefinition(quantifier = Quantifier.MULTIPLE) public interface Translator { String translate(String text); @ServiceFilterOnProperty(key = "translators", separator = ',', onMatch = true, onMiss = true, caseSensitive = false) String getName(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Allow to filter providers using a system property.
Examples:
javax.net.ssl.trustStoreType=Windows-ROOT
jdk.tls.disabledAlgorithms=SSLv3, RC4
https.cipherSuites=SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA,SSL_DHE_DSS_WITH_DES_CBC_SHA
The following code ...
... could be simplified as :
The text was updated successfully, but these errors were encountered: