Class IdeVersion

  • All Implemented Interfaces:
    com.jetbrains.plugin.structure.base.utils.Version<IdeVersion>, java.lang.Comparable<IdeVersion>

    public abstract class IdeVersion
    extends java.lang.Object
    implements com.jetbrains.plugin.structure.base.utils.Version<IdeVersion>
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.jetbrains.plugin.structure.base.utils.Version

        com.jetbrains.plugin.structure.base.utils.Version.DefaultImpls
    • Constructor Summary

      Constructors 
      Constructor Description
      IdeVersion()  
    • Constructor Detail

      • IdeVersion

        public IdeVersion()
    • Method Detail

      • createIdeVersion

        @NotNull
        public static @NotNull IdeVersion createIdeVersion​(@NotNull
                                                           @NotNull java.lang.String version)
                                                    throws java.lang.IllegalArgumentException
        Tries to parse specified string as IDE version and throws an IllegalArgumentException if the string is not a valid IDE version.
        Parameters:
        version - a string presentation of a version to be parsed
        Returns:
        an instance of IdeVersion
        Throws:
        java.lang.IllegalArgumentException - if specified version doesn't represent correct IdeVersion
        See Also:
        a version of the method that returns null instead of exception
      • createIdeVersionIfValid

        @Nullable
        public static @Nullable IdeVersion createIdeVersionIfValid​(@NotNull
                                                                   @NotNull java.lang.String version)
        Tries to parse specified string as IDE version and returns null if not succeed.
        Parameters:
        version - a string presentation of a version to be parsed
        Returns:
        instance of IdeVersion for specified string, or null if the string is not a valid IDE version
      • isValidIdeVersion

        public static boolean isValidIdeVersion​(@NotNull
                                                @NotNull java.lang.String version)
        Determines whether the specified string is a valid IdeVersion.
        Parameters:
        version - string which must be validated
        Returns:
        true if the specified string is a valid IdeVersion, false otherwise
      • asString

        @NotNull
        public abstract @NotNull java.lang.String asString​(boolean includeProductCode,
                                                           boolean includeSnapshotMarker)
        Returns a string presentation of this version. For the details of the presentation form refer to IntelliJ Build Number Ranges.

        Examples are:

        • IU-143.1532.7
        • IU-143.1532.SNAPSHOT
        • 143.1532
        • 7341 (for historical builds)
        • IU-7341
        • IU-162.94.11.256.42
        Parameters:
        includeProductCode - whether to append product code
        includeSnapshotMarker - whether to append SNAPSHOT marker (if present)
        Returns:
        string presentation of the ide version
      • asString

        @NotNull
        public @NotNull java.lang.String asString()
        Specified by:
        asString in interface com.jetbrains.plugin.structure.base.utils.Version<IdeVersion>
        Returns:
        Returns a presentation with the product code and SNAPSHOT marker (if present)
      • asStringWithoutProductCode

        @NotNull
        public @NotNull java.lang.String asStringWithoutProductCode()
        Specified by:
        asStringWithoutProductCode in interface com.jetbrains.plugin.structure.base.utils.Version<IdeVersion>
      • asStringWithoutProductCodeAndSnapshot

        public java.lang.String asStringWithoutProductCodeAndSnapshot()
      • getBaselineVersion

        public abstract int getBaselineVersion()
      • getBuild

        public abstract int getBuild()
      • isSnapshot

        public abstract boolean isSnapshot()
      • getComponents

        public abstract int[] getComponents()
      • asLong

        public abstract long asLong()
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public final int compareTo​(@NotNull
                                   @NotNull IdeVersion other)
        Specified by:
        compareTo in interface java.lang.Comparable<IdeVersion>