mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-30 00:48:52 +00:00
Add private constructor to utility classes to hide the implicit public one (#7850)
This commit is contained in:
parent
736637a598
commit
84a1b11b11
@ -8,6 +8,8 @@ import org.openmetadata.annotations.ExposedField;
|
||||
|
||||
public class AnnotationChecker {
|
||||
|
||||
private AnnotationChecker() {}
|
||||
|
||||
private static boolean checkIfAnyClassFieldsHasAnnotation(
|
||||
Class<?> objectClass, Class<? extends Annotation> annotationClass) {
|
||||
return checkIfAnyClassFieldsHasAnnotation(objectClass, annotationClass, new HashSet<>());
|
||||
|
||||
@ -15,6 +15,8 @@ import org.openmetadata.service.Entity;
|
||||
|
||||
@Slf4j
|
||||
public class ElasticSearchIndexFactory {
|
||||
private ElasticSearchIndexFactory() {}
|
||||
|
||||
public static ElasticSearchIndex buildIndex(String entityType, EntityInterface entity) {
|
||||
switch (entityType) {
|
||||
case Entity.TABLE:
|
||||
|
||||
@ -17,6 +17,8 @@ import org.openmetadata.schema.services.connections.metadata.SecretsManagerProvi
|
||||
|
||||
public class SecretsManagerFactory {
|
||||
|
||||
private SecretsManagerFactory() {}
|
||||
|
||||
public static SecretsManager createSecretsManager(SecretsManagerConfiguration config, String clusterName) {
|
||||
SecretsManagerProvider secretManager =
|
||||
config != null && config.getSecretsManager() != null
|
||||
|
||||
@ -110,6 +110,8 @@ public class WebSocketManager {
|
||||
}
|
||||
|
||||
public static class WebSocketManagerBuilder {
|
||||
private WebSocketManagerBuilder() {}
|
||||
|
||||
public static void build(EngineIoServerOptions eiOptions) {
|
||||
INSTANCE = new WebSocketManager(eiOptions);
|
||||
}
|
||||
|
||||
@ -267,6 +267,8 @@ public class EmailUtil {
|
||||
}
|
||||
|
||||
public static class EmailUtilBuilder {
|
||||
private EmailUtilBuilder() {}
|
||||
|
||||
public static EmailUtil build(SmtpSettings smtpServerSettings) {
|
||||
if (INSTANCE == null) {
|
||||
INSTANCE = new EmailUtil(smtpServerSettings);
|
||||
|
||||
@ -39,6 +39,8 @@ public class FilterUtil {
|
||||
private static final String TEST_CASE_RESULT = "testCaseResult";
|
||||
private static final String WILDCARD_FILTER = "all";
|
||||
|
||||
private FilterUtil() {}
|
||||
|
||||
public static boolean shouldProcessRequest(ChangeEvent changeEvent, Map<String, Map<EventType, Filters>> filtersMap) {
|
||||
if (filtersMap != null && !filtersMap.isEmpty()) {
|
||||
String entityType = changeEvent.getEntityType();
|
||||
|
||||
@ -34,6 +34,8 @@ public class PasswordUtil {
|
||||
validator = new PasswordValidator(rules);
|
||||
}
|
||||
|
||||
private PasswordUtil() {}
|
||||
|
||||
public static void validatePassword(String pwd) {
|
||||
PasswordData password = new PasswordData(pwd);
|
||||
RuleResult result = validator.validate(password);
|
||||
|
||||
@ -14,6 +14,8 @@ import org.openmetadata.schema.auth.RefreshToken;
|
||||
import org.openmetadata.schema.auth.TokenType;
|
||||
|
||||
public class TokenUtil {
|
||||
private TokenUtil() {}
|
||||
|
||||
public static TokenInterface createNewTokenWithDefaults(UUID userId, UUID tokenId, TokenType type) {
|
||||
switch (type) {
|
||||
case EMAIL_VERIFICATION:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user