Package ac.simons.neo4j.migrations.core
Enum Neo4jVersion
- All Implemented Interfaces:
Serializable
,Comparable<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 Summary
Enum ConstantDescriptionConstant when we assume the latest version.Constant for an undefined version.Constant for everything Neo4j 3.5 and earlier.Constant for everything Neo4j 4.0.Constant for everything Neo4j 4.1.Constant for everything Neo4j 4.2.Constant for everything Neo4j 4.3.Constant for everything Neo4j 4.4.Constant for everything Neo4j 5.0 -
Method Summary
Modifier and TypeMethodDescriptionint
int
boolean
boolean
boolean
static Neo4jVersion
Parses a version string in a lenient way.sanitizeSchemaName
(String potentiallyNonIdentifier) Escapes the string potentiallyNonIdentifier in all cases when it's not a valid Cypher identifier, fitting the given versionboolean
toString()
static Neo4jVersion
Returns the enum constant of this type with the specified name.static Neo4jVersion[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
UNDEFINED
Constant for an undefined version. -
V3_5
Constant for everything Neo4j 3.5 and earlier. -
V4_0
Constant for everything Neo4j 4.0. -
V4_1
Constant for everything Neo4j 4.1. -
V4_2
Constant for everything Neo4j 4.2. -
V4_3
Constant for everything Neo4j 4.3. -
V4_4
Constant for everything Neo4j 4.4. -
V5_0
Constant for everything Neo4j 5.0 -
LATEST
Constant when we assume the latest version.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
of
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
- Overrides:
toString
in classEnum<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
- Returns:
- The command recommended for this specific version to get a list of all known constraints
-
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
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
-