Class IdeVersion
- java.lang.Object
-
- com.jetbrains.plugin.structure.intellij.version.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>
-
-
Constructor Summary
Constructors Constructor Description IdeVersion()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract longasLong()@NotNull java.lang.StringasString()abstract @NotNull java.lang.StringasString(boolean includeProductCode, boolean includeSnapshotMarker)Returns a string presentation ofthisversion.@NotNull java.lang.StringasStringWithoutProductCode()java.lang.StringasStringWithoutProductCodeAndSnapshot()intcompareTo(@NotNull IdeVersion other)static @NotNull IdeVersioncreateIdeVersion(@NotNull java.lang.String version)Tries to parse specified string as IDE version and throws anIllegalArgumentExceptionif the string is not a valid IDE version.static @Nullable IdeVersioncreateIdeVersionIfValid(@NotNull java.lang.String version)Tries to parse specified string as IDE version and returns null if not succeed.booleanequals(java.lang.Object obj)abstract intgetBaselineVersion()abstract intgetBuild()abstract int[]getComponents()inthashCode()abstract booleanisSnapshot()static booleanisValidIdeVersion(@NotNull java.lang.String version)Determines whether the specified string is a validIdeVersion.
-
-
-
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 anIllegalArgumentExceptionif 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 specifiedversiondoesn't represent correctIdeVersion- 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
IdeVersionfor 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 validIdeVersion.- 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 ofthisversion. 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 codeincludeSnapshotMarker- whether to append SNAPSHOT marker (if present)- Returns:
- string presentation of the ide version
-
asString
@NotNull public @NotNull java.lang.String asString()
- Specified by:
asStringin interfacecom.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:
asStringWithoutProductCodein interfacecom.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:
hashCodein classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public final int compareTo(@NotNull @NotNull IdeVersion other)- Specified by:
compareToin interfacejava.lang.Comparable<IdeVersion>
-
-