Class ScalaVersion

java.lang.Object
org.scoverage.plugin.ScalaVersion

public class ScalaVersion extends Object
Inspired by scala-maven-plugin's VersionNumber.java
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The bugfix Scala version number. e.g. for 2.10.0-M1, this would be 0.
    The binary compatible version number for this Scala version.
    The full version number, including the modifier if any.
    int
    The major Scala version number. e.g. for 2.10.0-M1, this would be 2.
    int
    The minor Scala version number. e.g. for 2.10.0-M1, this would be 10.
    The modifier for this Scala version. e.g. for 2.10.0-M1, this would be M1.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a ScalaVersion from a String.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isAtLeast(String scalaVersion)
    Ignores modifier, so can return `true` for any ScalaVersion with matching major, minor, bugfix.
    boolean
    Ignores modifier, so can return `true` for any ScalaVersion with matching major, minor, bugfix.
    boolean
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • full

      public String full
      The full version number, including the modifier if any.
    • compatible

      public String compatible
      The binary compatible version number for this Scala version. e.g. for 2.10.0-M1, this would be 2.10.0-M1, for 2.10.0, this would be 2.10, for 3.3.1, this would be 3.
    • major

      public int major
      The major Scala version number. e.g. for 2.10.0-M1, this would be 2.
    • minor

      public int minor
      The minor Scala version number. e.g. for 2.10.0-M1, this would be 10.
    • bugfix

      public int bugfix
      The bugfix Scala version number. e.g. for 2.10.0-M1, this would be 0.
    • modifier

      public String modifier
      The modifier for this Scala version. e.g. for 2.10.0-M1, this would be M1.
  • Constructor Details

    • ScalaVersion

      public ScalaVersion(String s)
      Creates a ScalaVersion from a String.
      Parameters:
      s - String to parse
  • Method Details

    • isAtLeast

      public boolean isAtLeast(ScalaVersion other)
      Ignores modifier, so can return `true` for any ScalaVersion with matching major, minor, bugfix.
      Parameters:
      other - ScalaVersion to compare to
      Returns:
      true if this version is of the same or newer Scala version as the other version
    • isAtLeast

      public boolean isAtLeast(String scalaVersion)
      Ignores modifier, so can return `true` for any ScalaVersion with matching major, minor, bugfix.
      Parameters:
      scalaVersion - to compare to
      Returns:
      true if this version is of the same or newer Scala version as the other version
    • isScala2

      public boolean isScala2()
      Returns:
      true if this is a Scala 2 version