Class ElasticsearchVersion
- java.lang.Object
-
- org.hibernate.search.backend.elasticsearch.ElasticsearchVersion
-
public class ElasticsearchVersion extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
major()
boolean
matches(ElasticsearchVersion other)
OptionalInt
micro()
OptionalInt
minor()
static ElasticsearchVersion
of(String versionString)
Optional<String>
qualifier()
String
toString()
-
-
-
Method Detail
-
of
public static ElasticsearchVersion of(String versionString)
- Parameters:
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
.- Returns:
- An
ElasticsearchVersion
object representing the given version. - Throws:
SearchException
- If the input string doesn't follow the required format.
-
major
public int major()
- Returns:
- The "major" number of this version, i.e. the
x
inx.y.z-qualifier
.
-
minor
public OptionalInt minor()
- Returns:
- The "minor" number of this version, i.e. the
y
inx.y.z-qualifier
. May be empty.
-
micro
public OptionalInt micro()
- Returns:
- The "minor" number of this version, i.e. the
z
inx.y.z-qualifier
. May be empty.
-
qualifier
public Optional<String> qualifier()
- Returns:
- The qualifier in this version, i.e. the
qualifier
inx.y.z-qualifier
. May be empty.
-
matches
public boolean matches(ElasticsearchVersion other)
- 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.
-
-