Interface UnitRepositoryService


  • public interface UnitRepositoryService
    • Method Detail

      • findUnitByUnitNumber

        UnitContract findUnitByUnitNumber​(String unitNumber)
        Finds a unit by unit number. The unit number cannot be blank.
        Parameters:
        unitNumber - the unit number. Cannot be blank.
        Returns:
        the unit or null if not found.
        Throws:
        IllegalArgumentException - if the unitNumber is blank
      • findTopUnit

        UnitContract findTopUnit()
        Finds the top unit in the hierarchy.
        Returns:
        the unit or null if not found.
      • getUnitHierarchyForUnit

        List<UnitContract> getUnitHierarchyForUnit​(String unitNumber)
        Finds the hierarchy for unit,including all the parent units and the unit itself. If no matching Units are found an empty list is returned. The unit number cannot be blank.
        Parameters:
        unitNumber - the unit number. cannot be blank.
        Returns:
        a list of Units or an empty list if not found.
        Throws:
        IllegalArgumentException - if the unitNumber is blank