LoggerInitializerDeclaration (@NotNull String customDeclaration) { final Matcher declarationMatcher = DECLARATION_PATTERN.matcher(customDeclaration); if (!declarationMatcher.matches()) { return null; } List<LoggerInitializerParameter> withTopic = null; List<LoggerInitializerParameter> withoutTopic = null; final Matcher allParametersMatcher = PARAMETERS_PATTERN.matcher(declarationMatcher.group(4)); while (allParametersMatcher.find()) { final List<LoggerInitializerParameter> splitParameters = splitParameters(allParametersMatcher.group(1)); if (splitParameters.contains(LoggerInitializerParameter.UNKNOWN)) { return null; } if (splitParameters.contains(LoggerInitializerParameter.TOPIC)) { if (withTopic != null) { return null; } withTopic = splitParameters; } else { if (withoutTopic != null) { return null; } withoutTopic = splitParameters; } } return new LoggerInitializerDeclaration(withTopic, withoutTopic); }