Class Partitions


  • public final class Partitions
    extends java.lang.Object
    Partitions utility class providing partitioning functionality.
    • Method Detail

      • getPartKeyValues

        public static java.util.Map<java.lang.String,​java.util.List<java.lang.Object>> getPartKeyValues​(ResourceSet resourceSet)
                                                                                                       throws java.lang.IllegalAccessException
        Get partition keys plus values of a given resource set.
        Parameters:
        resourceSet - The resource set to be analyzed.
        Returns:
        Map of partition keys plus values.
        Throws:
        java.lang.IllegalAccessException
      • getResourcesByPartKeys

        public static java.util.List<Resource> getResourcesByPartKeys​(ResourceSet resourceSet,
                                                                      java.lang.String... partKeys)
      • getResourceByPart

        public static Resource getResourceByPart​(ResourceSet resourceSet,
                                                 Part part)
        Identifies and returns a Resource within a ResourceSet using parition keys.
        This is the official CIP4 reference implementation of the XJDF partitioning algorithm.
        Parameters:
        resourceSet - The ResourceSet containing a set of partitioned Resources.
        part - The given Partition Keys used to identify a particular Resource
        Returns:
        The Resource identified using partition keys.
      • hasMismatchingAttributes

        public static boolean hasMismatchingAttributes​(@NotNull
                                                       @NotNull Part partition1,
                                                       @NotNull
                                                       @NotNull Part partition2)
        Check two partitions for mismatching attributes.
        Parameters:
        partition1 - First partition to check.
        partition2 - Other partition to check.
        Returns:
        Will return true if both partitions define the same attribute but with different values and false otherwise.