java.lang.Object
ac.simons.neo4j.migrations.core.internal.Strings

public final class Strings extends Object
Internally used String utilities. There are no guarantees on the stability of this API. It won't be available when run on the module path.
Since:
1.2.2
Author:
Michael J. Simon
  • Field Details

    • CYPHER_SINGLE_LINE_COMMENT

      public static final String CYPHER_SINGLE_LINE_COMMENT
      Single line comment indicator.
      See Also:
    • LINE_DELIMITER

      public static final String LINE_DELIMITER
      Pattern used for splitting lines.
      See Also:
  • Method Details

    • capitalize

      public static String capitalize(String value)
      Capitalizees a string
      Parameters:
      value - String to capitalize
      Returns:
      Capitalized String or the original value if unchanged or if the value was null or empty.
    • toCamelCase

      public static String toCamelCase(String value)
      Transforms a string with words separated by _ into a camelCase string.
      Parameters:
      value - The value to transform
      Returns:
      the value in camelCase
    • isSingleLineComment

      public static boolean isSingleLineComment(String statement)
      This won't match a statement like
           // Right at the start
           MATCH (n) RETURN count(n) AS n;
       
      which will pe extracted from a Cypher file as one statement starting with a comment.

      It would be nice to use the JavaCC Parser here as we do in Cypher-DSL, but that would require Java 11 for core.

      Parameters:
      statement - A statement to check
      Returns:
      True if the statement is not null and is a single line comment