Enum Neo4jVersion

java.lang.Object
java.lang.Enum<Neo4jVersion>
ac.simons.neo4j.migrations.core.Neo4jVersion
All Implemented Interfaces:
Serializable, Comparable<Neo4jVersion>

public enum Neo4jVersion extends Enum<Neo4jVersion>
Simplified Neo4j version, fuzzy if you want so (just looking at Major.Minor, not the patches).
Since:
1.7.0
Author:
Michael J. Simons
  • Enum Constant Details

    • UNDEFINED

      public static final Neo4jVersion UNDEFINED
      Constant for an undefined version.
    • V3_5

      public static final Neo4jVersion V3_5
      Constant for everything Neo4j 3.5 and earlier.
    • V4_0

      public static final Neo4jVersion V4_0
      Constant for everything Neo4j 4.0.
    • V4_1

      public static final Neo4jVersion V4_1
      Constant for everything Neo4j 4.1.
    • V4_2

      public static final Neo4jVersion V4_2
      Constant for everything Neo4j 4.2.
    • V4_3

      public static final Neo4jVersion V4_3
      Constant for everything Neo4j 4.3.
    • V4_4

      public static final Neo4jVersion V4_4
      Constant for everything Neo4j 4.4.
    • V5_0

      public static final Neo4jVersion V5_0
      Constant for everything Neo4j 5.0
    • LATEST

      public static final Neo4jVersion LATEST
      Constant when we assume the latest version.
  • Method Details

    • values

      public static Neo4jVersion[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Neo4jVersion valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static Neo4jVersion of(String version)
      Parses a version string in a lenient way. Only Major and Minor versions are looked at.
      Parameters:
      version - A version string
      Returns:
      A version
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Neo4jVersion>
    • isPriorTo44

      public boolean isPriorTo44()
      Returns:
      true if this is a version prior to 4.4.
    • hasIdempotentOperations

      public boolean hasIdempotentOperations()
      Returns:
      true if this version has idempotent operations
    • hasTextIndexes

      public boolean hasTextIndexes()
      Returns:
      true if this version has text indexes
    • supportsSchemaOptions

      public boolean supportsSchemaOptions()
      Returns:
      true if this version supports specifying options on constraints and indexes.
      Since:
      1.13.0
    • getShowConstraints

      public String getShowConstraints()
      Returns:
      The command recommended for this specific version to get a list of all known constraints
    • getShowIndexes

      public String getShowIndexes()
      Returns:
      The command recommended for this specific version to get a list of all known indexes
    • getMajorVersion

      public int getMajorVersion()
      Returns:
      The major version of the database.
      Since:
      1.10.0
    • getMinorVersion

      public int getMinorVersion()
      Returns:
      The minor version or -1 if it can be determined
      Since:
      1.11.0
    • sanitizeSchemaName

      public String sanitizeSchemaName(String potentiallyNonIdentifier)
      Escapes the string potentiallyNonIdentifier in all cases when it's not a valid Cypher identifier, fitting the given version
      Parameters:
      potentiallyNonIdentifier - A value to escape, must not be null or blank
      Returns:
      The sanitized and quoted value or the same value if no change is necessary.
      Since:
      1.11.0