public SchemaInfoLevelBuilder withTag(final String tag) { if (isBlank(tag)) { this.tag = ""; } else { this.tag = tag; } return this; }
@Override public int compare(final NamedObject namedObject1, final NamedObject namedObject2) { return convertForComparison(namedObject1.getFullName()) .compareTo(convertForComparison(namedObject2.getFullName())); } },
/** * Sets the application-wide log level. */ public static void applyApplicationLogLevel(final Level applicationLogLevel) { Utility.applyApplicationLogLevel(applicationLogLevel); }
final String commonPrefix = Utility.commonPrefix(table1, table2); if (!isBlank(commonPrefix) && commonPrefix.endsWith("_"))
for (final String arg: args) if (isBlank(arg)) else if (containsWhitespace(arg))
public static void logSystemProperties() { if (!LOGGER.isLoggable(Level.CONFIG)) { return; } final SortedMap<String, String> systemProperties = new TreeMap<>(); for (final Entry<Object, Object> propertyValue: System.getProperties() .entrySet()) { final String name = (String) propertyValue.getKey(); if ((name.startsWith("java.") || name.startsWith("os.")) && !name.endsWith(".path")) { systemProperties.put(name, (String) propertyValue.getValue()); } } LOGGER.log(Level.CONFIG, String.format("System properties: %n%s", join(systemProperties, System.lineSeparator()))); }
@Test public void containsWhitespaceTest() { assertThat(containsWhitespace(null), is(false)); assertThat(containsWhitespace("\t" + "abcd"), is(true)); assertThat(containsWhitespace("abcd" + "\t"), is(true)); assertThat(containsWhitespace("ab" + "\t" + "cd"), is(true)); }
public static String commonPrefix(final String string1, final String string2) { if (string1 == null || string2 == null) { return ""; } final int index = indexOfDifference(string1, string2); if (index == -1) { return null; } else { return string1.substring(0, index).toLowerCase(); } }
@Test public void isClassAvailableTest() { assertThat(isClassAvailable("java.lang.String"), is(true)); assertThat(isClassAvailable("com.example.Unknown"), is(false)); }
@Test public void commonPrefixTest() { assertThat(commonPrefix("preTest", null), is("")); assertThat(commonPrefix(null, "preCompile"), is("")); assertThat(commonPrefix("preTest", "preCompile"), is("pre")); assertThat(commonPrefix("something", "nothing"), is("")); assertThat(commonPrefix("preTest", ""), is("")); }
final String commonPrefix = Utility.commonPrefix(table1, table2); if (!isBlank(commonPrefix) && commonPrefix.endsWith("_"))
for (final String arg: args) if (isBlank(arg)) else if (containsWhitespace(arg))
public static void logSystemProperties() { if (!LOGGER.isLoggable(Level.CONFIG)) { return; } final SortedMap<String, String> systemProperties = new TreeMap<>(); for (final Entry<Object, Object> propertyValue: System.getProperties() .entrySet()) { final String name = (String) propertyValue.getKey(); if ((name.startsWith("java.") || name.startsWith("os.")) && !name.endsWith(".path")) { systemProperties.put(name, (String) propertyValue.getValue()); } } LOGGER.log(Level.CONFIG, String.format("System properties: %n%s", join(systemProperties, System.lineSeparator()))); }
boolean needsToBeQuoted(final String name) { final boolean needsToBeQuoted; if (name != null && identifierQuoteString != null && (Utility.containsWhitespace(name) || reservedWords.contains(name .toUpperCase()))) { needsToBeQuoted = true; } else { needsToBeQuoted = false; } return needsToBeQuoted; }
public static String commonPrefix(final String string1, final String string2) { if (string1 == null || string2 == null) { return ""; } final int index = indexOfDifference(string1, string2); if (index == -1) { return null; } else { return string1.substring(0, index).toLowerCase(); } }
public static boolean isGraphvizJavaAvailable(final GraphOutputFormat graphOutputFormat) { final String className = "guru.nidi.graphviz.engine.Graphviz"; final boolean hasClass = Utility.isClassAvailable(className); final boolean supportsFormat = canMap(graphOutputFormat); LOGGER.log(Level.INFO, new StringFormat("Checking if diagram can be generated - " + " can load <%s> = <%b>, " + " can generate format <%s> = <%b>", className, hasClass, graphOutputFormat.getDescription(), supportsFormat)); return hasClass && supportsFormat; }
public SchemaInfoLevelBuilder withTag(final String tag) { if (isBlank(tag)) { this.tag = ""; } else { this.tag = tag; } return this; }
final String commonPrefix = Utility.commonPrefix(table1, table2); if (!isBlank(commonPrefix) && commonPrefix.endsWith("_"))
for (final String arg: args) if (isBlank(arg)) else if (containsWhitespace(arg))
@Override public int compare(final NamedObject namedObject1, final NamedObject namedObject2) { return convertForComparison(namedObject1.getFullName()) .compareTo(convertForComparison(namedObject2.getFullName())); } },