Class ElasticsearchVersion
java.lang.Object
org.hibernate.search.backend.elasticsearch.ElasticsearchVersion
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
int
major()
Deprecated.boolean
matches
(ElasticsearchVersion other) micro()
minor()
static ElasticsearchVersion
static ElasticsearchVersion
of
(ElasticsearchDistributionName distribution, String versionString) toString()
-
Method Details
-
of
- Parameters:
distributionAndVersionString
- A version string following the formatx.y.z-qualifier
or<distribution>:x.y.z-qualifier
, where<distribution>
is a string accepted byElasticsearchDistributionName.of(String)
,x
,y
andz
are integers andqualifier
is a string of word characters (alphanumeric or '_'). Incomplete versions are allowed, for example 'elastic:7.0',7.0
or just7
.- Returns:
- An
ElasticsearchVersion
object representing the given version. - Throws:
SearchException
- If the input string doesn't follow the required format.
-
of
public static ElasticsearchVersion of(ElasticsearchDistributionName distribution, String versionString) - Parameters:
distribution
- A distribution name.versionString
- A version string following the formatx.y.z-qualifier
, wherex
,y
andz
are integers andqualifier
is a string of word characters (alphanumeric or '_'). Incomplete versions are allowed, for example7.0
or just7
. Null is allowed.- Returns:
- An
ElasticsearchVersion
object representing the given version. - Throws:
SearchException
- If the input string doesn't follow the required format.
-
equals
-
hashCode
public int hashCode() -
toString
-
versionString
- Returns:
- The version string, i.e. the version without the distribution prefix.
-
distribution
- Returns:
- The distribution to which this version applies, e.g.
ElasticsearchDistributionName.ELASTIC
orElasticsearchDistributionName.OPENSEARCH
.
-
major
Deprecated.UsemajorOptional()
instead.- Returns:
- The "major" number of this version, i.e. the
x
inx.y.z-qualifier
.
-
majorOptional
- Returns:
- The "major" number of this version, i.e. the
x
inx.y.z-qualifier
. May be empty.
-
minor
- Returns:
- The "minor" number of this version, i.e. the
y
inx.y.z-qualifier
. May be empty.
-
micro
- Returns:
- The "minor" number of this version, i.e. the
z
inx.y.z-qualifier
. May be empty.
-
qualifier
- Returns:
- The qualifier in this version, i.e. the
qualifier
inx.y.z-qualifier
. May be empty.
-
matches
- Parameters:
other
- A version to be matched against this version.- Returns:
true
if the other version matches this version, i.e. if all the components defined in this version are also defined in the other version with the same value.false
otherwise. Components that are not defined in this version do not matter.
-
majorOptional()
instead.