Class JavaVersion

java.lang.Object
org.springframework.data.gemfire.util.JavaVersion
All Implemented Interfaces:
Comparable<JavaVersion>

public abstract class JavaVersion extends Object implements Comparable<JavaVersion>
Java class to represent the current version of the JRE or JVM.
Since:
2.6.0
  • Field Details

  • Constructor Details

    • JavaVersion

      protected JavaVersion(int major, int minor)
    • JavaVersion

      protected JavaVersion(int major, int minor, int patch)
    • JavaVersion

      protected JavaVersion(int major, int minor, int patch, int buildNumber)
  • Method Details

    • of

      protected static JavaVersion of(int major, int minor, int patch)
    • current

      public static JavaVersion current()
    • isJava8

      public boolean isJava8()
    • isJava11

      public boolean isJava11()
    • isJava17

      public boolean isJava17()
    • isNewerThanOrEqualTo

      public boolean isNewerThanOrEqualTo(@Nullable JavaVersion javaVersion)
    • isOlderThan

      public boolean isOlderThan(@Nullable JavaVersion javaVersion)
    • isUndetermined

      public boolean isUndetermined()
    • getMajor

      @NonNull public Integer getMajor()
    • getMinor

      @NonNull public Integer getMinor()
    • getPatch

      @NonNull public Integer getPatch()
    • getBuildNumber

      @NonNull public Integer getBuildNumber()
    • compareTo

      public int compareTo(@NonNull JavaVersion version)
      Specified by:
      compareTo in interface Comparable<JavaVersion>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @NonNull public String toString()
      Overrides:
      toString in class Object