Class StructureStateUtils

java.lang.Object
de.hybris.platform.patches.utils.StructureStateUtils

public final class StructureStateUtils extends Object
This utils class supports calculation related with StructureState around ImportOrganisationUnit.
  • Method Details

    • getNewGlobalLanguages

      public static Set<ImportLanguage> getNewGlobalLanguages(ImportOrganisationUnit[] units, StructureState structureState)
      This method returns set of languages that were defined for ImportOrganisationUnit introduced in given structureState (and were not used in any structureState before).
      It means that:
      • languages that were used by organisation that were defined in given structureState are added to result
      • languages that were used by organisation that were defined in previous structureStates are extracted from result
      Parameters:
      units - array of all units in the system, regardless of structureState for which these were defined
      structureState - structureState for which languages are checked StructureState
      Returns:
      set of ImportLanguage that are new for given structureState
    • getAllGlobalLanguages

      public static Set<ImportLanguage> getAllGlobalLanguages(ImportOrganisationUnit[] units, StructureState structureState)
      This method returns set of languages that were defined for ImportOrganisationUnit-s introduced until given structureState (including).
      It means that:
      • languages that were used by organisation that were defined in given or previous structureState are added to result
      Parameters:
      units - array of all units in the system, regardless of structureState for which these were defined
      structureState - structureState for which languages are checked StructureState
      Returns:
      set of ImportLanguage that were defined until given structureState
    • getNewLanguages

      public static Set<ImportLanguage> getNewLanguages(ImportOrganisationUnit unit, StructureState structureState)
      This method returns set of languages that were defined for child ImportOrganisationUnit introduced in given structureState (and were not used in any structureState before).
      Parameters:
      unit - that children are checked
      structureState - that children are checked against
      Returns:
      set of all languages defined in children organisation in given structureState without languages that were defined earlier
    • getStructureStateGap

      public static List<StructureState> getStructureStateGap(StructureState currentStructureState, StructureState executedStructureState)
      This method returns list of StructureState that is between executedStructureState (excluding) and currentStructureState (including). In case currentStructureState equals executedStructureState an empty list is returned.
      Parameters:
      currentStructureState - StructureState currently imported
      executedStructureState - StructureState that were already imported for previous patch
      Returns:
      list of StructureStates