Class RuntimeInstallations
- java.lang.Object
-
- com._1c.g5.v8.dt.platform.services.core.runtimes.RuntimeInstallations
-
public final class RuntimeInstallations extends Object
1C:Enterprise runtime installations utility methods.- Restriction:
- This class is not intended to be sub-classed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENTERPRISE_PLATFORM
The type of 1C:Enteprise runtime for the 1C:Enteprise runtime enterprise platform.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
contains(Collection<RuntimeInstallation> installations, RuntimeInstallation candidate)
Returns whether the provided 1C:Enterprise runtime installation is contained inside the provided 1C:Enterprise runtime installations collection.static boolean
equals(RuntimeInstallation first, RuntimeInstallation second)
Determines whether two possibly-null
1C:Enterprise runtime installations are equal.static RuntimeInstallation
findByLocation(URI location, Collection<RuntimeInstallation> installations)
Finds the 1C:Enterprise runtime installation by the provided install location.static RuntimeInstallation
findByUuid(UUID uuid, Collection<RuntimeInstallation> installations)
Finds a 1C:Enterprise runtime installation by the providedUUID
.static RuntimeInstallation
findByVersion(Version version, int build, Arch arch, Collection<RuntimeInstallation> installations)
Finds 1C:Enterprise runtime installation by the provided version, the build number and the architecture.static RuntimeInstallation
findByVersion(Version version, int build, Collection<RuntimeInstallation> installations)
Finds 1C:Enterprise runtime installation by the provided version and the build number.static List<String>
getNames(Collection<RuntimeInstallation> installations)
Returns a collection of all names of provided 1C:Enterprise runtime installations.static boolean
isFile(URI installationLocation)
Returns whether the provided 1C:Enterprise runtime platform installation location is file-system.static List<RuntimeInstallation>
merge(Collection<RuntimeInstallation> first, Collection<RuntimeInstallation> second)
Merges two provided lists ofRuntimeInstallation
by installation path equality.static RuntimeInstallation
newRuntimeInstallation(URI location)
Creates and returns model instance of 1C:Enterprise runtime installation with the provided location.static RuntimeInstallation
newRuntimeInstallation(URI location, Version version, int build)
Creates and returns model instance of 1C:Enterprise runtime installation with the provided location and version.static Comparator<RuntimeInstallation>
orderByVersion()
Returns comparator that compares two 1C:Enteprise runtime installations by the version and build number.
-
-
-
Field Detail
-
ENTERPRISE_PLATFORM
public static final String ENTERPRISE_PLATFORM
The type of 1C:Enteprise runtime for the 1C:Enteprise runtime enterprise platform. Value is "com._1c.g5.v8.dt.platform.services.core.runtimeType.EnterprisePlatform".- See Also:
- Constant Field Values
-
-
Method Detail
-
isFile
public static boolean isFile(URI installationLocation)
Returns whether the provided 1C:Enterprise runtime platform installation location is file-system.- Parameters:
installationLocation
- the 1C:Enterprise runtime platform installation location, cannot benull
- Returns:
- whether the provided 1C:Enterprise runtime platform installation is file-system
-
contains
public static boolean contains(Collection<RuntimeInstallation> installations, RuntimeInstallation candidate)
Returns whether the provided 1C:Enterprise runtime installation is contained inside the provided 1C:Enterprise runtime installations collection. Method usesRuntimeInstallations.equals
instead of objects identity.- Parameters:
installations
- a collection of installations, cannot benull
candidate
- the installation to check containment for, cannot benull
- Returns:
- whether the provided installation is contained inside the provided installations collection
-
equals
public static boolean equals(RuntimeInstallation first, RuntimeInstallation second)
Determines whether two possibly-null
1C:Enterprise runtime installations are equal. Returns:true
iffirst
andsecond
are bothnull
.true
iffirst
andsecond
are both non-null
and they have sameUUID
.false
in all other situations.
- Parameters:
first
- the fist 1C:Enterprise runtime installation to check equalitysecond
- the second 1C:Enterprise runtime installation to check equality- Returns:
- whether two possibly-
null
1C:Enterprise runtime installations are equal
-
findByLocation
public static RuntimeInstallation findByLocation(URI location, Collection<RuntimeInstallation> installations)
Finds the 1C:Enterprise runtime installation by the provided install location. Can returnnull
, if not found.- Parameters:
location
- the install location to find the 1C:Enterprise runtime installation, cannot benull
installations
- a collection of 1C:Enterprise runtime installations to search in, cannot benull
- Returns:
- the 1C:Enterprise runtime installation with the provided path or
null
, if not found
-
findByUuid
public static RuntimeInstallation findByUuid(UUID uuid, Collection<RuntimeInstallation> installations)
Finds a 1C:Enterprise runtime installation by the providedUUID
. Can returnnull
if not found.- Parameters:
uuid
- the UUID to find 1C:Enterprise runtime installation with, cannot benull
installations
- a collection of 1C:Enterprise runtime installations to search in, cannot benull
- Returns:
- the 1C:Enterprise runtime installation by provided
UUID
, ornull
if not found
-
findByVersion
public static RuntimeInstallation findByVersion(Version version, int build, Collection<RuntimeInstallation> installations)
Finds 1C:Enterprise runtime installation by the provided version and the build number. Can returnnull
if not found.- Parameters:
version
- the 1C:Enterprise runtime version, cannot benull
version
- the 1C:Enterprise runtime buildinstallations
- a collection of 1C:Enterprise runtime installations to search in, cannot benull
- Returns:
- 1C:Enterprise runtime installation by provided version, or
null
if not found
-
findByVersion
public static RuntimeInstallation findByVersion(Version version, int build, Arch arch, Collection<RuntimeInstallation> installations)
Finds 1C:Enterprise runtime installation by the provided version, the build number and the architecture. Can returnnull
if not found.- Parameters:
version
- the 1C:Enterprise runtime version, cannot benull
version
- the 1C:Enterprise runtime buildinstallations
- a collection of 1C:Enterprise runtime installations to search in, cannot benull
- Returns:
- 1C:Enterprise runtime installation by provided version, or
null
if not found
-
getNames
public static List<String> getNames(Collection<RuntimeInstallation> installations)
Returns a collection of all names of provided 1C:Enterprise runtime installations.- Parameters:
installations
- 1C:Enterprise runtime installations to get names for, cannot benull
- Returns:
- a list of all names, never
null
-
merge
public static List<RuntimeInstallation> merge(Collection<RuntimeInstallation> first, Collection<RuntimeInstallation> second)
Merges two provided lists ofRuntimeInstallation
by installation path equality. Result list will contain elements of first list and those elements of second list with paths, that not present in first list.- Parameters:
first
- the first list of 1C:Enterprise runtime intallations, cannot benull
second
- the second list of 1C:Enterprise runtime intallations, cannot benull
- Returns:
- a merged list, never
null
-
newRuntimeInstallation
public static RuntimeInstallation newRuntimeInstallation(URI location)
Creates and returns model instance of 1C:Enterprise runtime installation with the provided location.- Parameters:
location
- the location of the 1C:Enterprise runtime, cannot benull
- Returns:
- a new instance of 1C:Enterprise runtime installation, never
null
-
newRuntimeInstallation
public static RuntimeInstallation newRuntimeInstallation(URI location, Version version, int build)
Creates and returns model instance of 1C:Enterprise runtime installation with the provided location and version.- Parameters:
location
- the location of the 1C:Enterprise runtime, cannot benull
version
- the version of the 1C:Enterprise runtime, cannot benull
build
- the build number of the 1C:Enterprise runtime- Returns:
- a new instance of 1C:Enterprise runtime installation, never
null
-
orderByVersion
public static Comparator<RuntimeInstallation> orderByVersion()
Returns comparator that compares two 1C:Enteprise runtime installations by the version and build number.- Returns:
- comparator that compares two 1C:Enteprise runtime installations by the version and build number,
never
null
-
-