class GraphName {

    public static boolean isValidTopic(final String name) {
        // Delete sample Regex : https://regex101.com/delete/7qMZiThwlEla6eAKIIee3251
        boolean result = name != null;

        if (result) {
            final String topicName = GraphName.removeSheme(name);

            result =
                    topicName != null &&
                    topicName.length() > 0 &&
                    topicName.matches("^(?!.*(//|__|_/))[~A-Za-z/_{}][_A-Za-z0-9/{}]*$") &&
                    !topicName.endsWith(PRIVATE) &&
                    !topicName.endsWith(SEPARATOR)
            ;

            if (result && topicName.startsWith(RELATIVE) && topicName.length() > 1) {
                result = topicName.startsWith(RELATIVE_TOPIC);
            }
        }

        return result;
    }

    private  GraphName();

}