Class 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 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 be null
        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 uses RuntimeInstallations.equals instead of objects identity.
        Parameters:
        installations - a collection of installations, cannot be null
        candidate - the installation to check containment for, cannot be null
        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 if first and second are both null.
        • true if first and second are both non-null and they have same UUID.
        • false in all other situations.
        Parameters:
        first - the fist 1C:Enterprise runtime installation to check equality
        second - 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 return null, if not found.
        Parameters:
        location - the install location to find the 1C:Enterprise runtime installation, cannot be null
        installations - a collection of 1C:Enterprise runtime installations to search in, cannot be null
        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 provided UUID. Can return null if not found.
        Parameters:
        uuid - the UUID to find 1C:Enterprise runtime installation with, cannot be null
        installations - a collection of 1C:Enterprise runtime installations to search in, cannot be null
        Returns:
        the 1C:Enterprise runtime installation by provided UUID, or null 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 return null if not found.
        Parameters:
        version - the 1C:Enterprise runtime version, cannot be null
        version - the 1C:Enterprise runtime build
        installations - a collection of 1C:Enterprise runtime installations to search in, cannot be null
        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 return null if not found.
        Parameters:
        version - the 1C:Enterprise runtime version, cannot be null
        version - the 1C:Enterprise runtime build
        installations - a collection of 1C:Enterprise runtime installations to search in, cannot be null
        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 be null
        Returns:
        a list of all names, never null
      • merge

        public static List<RuntimeInstallation> merge​(Collection<RuntimeInstallation> first,
                                                      Collection<RuntimeInstallation> second)
        Merges two provided lists of RuntimeInstallation 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 be null
        second - the second list of 1C:Enterprise runtime intallations, cannot be null
        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 be null
        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 be null
        version - the version of the 1C:Enterprise runtime, cannot be null
        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