Package org.motechproject.mots.mapper
Interface LocationMapper
-
public interface LocationMapper
-
-
Field Summary
Fields Modifier and Type Field Description static LocationMapper
INSTANCE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description District
fromDtoToDistrict(DistrictCreationDto districtCreationDto)
Facility
fromDtoToFacility(FacilityCreationDto facilityCreationDto)
Sector
fromDtoToSector(SectorCreationDto sectorCreationDto)
Village
fromDtoToVillage(VillageCreationDto villageCreationDto)
default District
toDistrict(java.lang.String districtId)
Create District object with given id.DistrictCreationDto
toDistrictCreationDto(District district)
java.util.List<DistrictDto>
toDistrictDtos(java.util.List<District> districts)
Convert district list to district dtos list.FacilityDto
toDto(Facility facility)
default Facility
toFacility(java.lang.String facilityId)
Create Facility object with given id.FacilityCreationDto
toFacilityCreationDto(Facility facility)
FacilityExtendedInfoDto
toFacilityExtendedInfoDto(Facility facility)
LocationPreviewDto
toLocationPreviewDto(Location location)
default java.util.Set<LocationPreviewDto>
toLocationPreviewDtos(java.util.List<? extends Location> locations)
Convert location set to location preview dto set.default java.util.List<LocationPreviewDto>
toLocationPreviewDtosWithOrder(java.util.List<? extends Location> locations)
Convert location list to location preview dto list.default Sector
toSector(java.lang.String sectorId)
Create Sector object with given id.SectorCreationDto
toSectorCreationDto(Sector sector)
VillageCreationDto
toVillageCreationDto(Village village)
VillageExtendedInfoDto
toVillageExtendedInfoDto(Village village)
void
updateDistrictFromDto(DistrictCreationDto districtCreationDto, District district)
void
updateFacilityFromDto(FacilityCreationDto facilityCreationDto, Facility facility)
void
updateSectorFromDto(SectorCreationDto sectorCreationDto, Sector sector)
void
updateVillageFromDto(VillageCreationDto villageCreationDto, Village village)
-
-
-
Field Detail
-
INSTANCE
static final LocationMapper INSTANCE
-
-
Method Detail
-
toDistrictDtos
java.util.List<DistrictDto> toDistrictDtos(java.util.List<District> districts)
Convert district list to district dtos list.- Parameters:
districts
- list of districts- Returns:
- list of district dtos
-
toDto
FacilityDto toDto(Facility facility)
-
toLocationPreviewDtos
default java.util.Set<LocationPreviewDto> toLocationPreviewDtos(java.util.List<? extends Location> locations)
Convert location set to location preview dto set.- Parameters:
locations
- set of locations of any type- Returns:
- map of Village dtos, where the key is the village id
-
toLocationPreviewDtosWithOrder
default java.util.List<LocationPreviewDto> toLocationPreviewDtosWithOrder(java.util.List<? extends Location> locations)
Convert location list to location preview dto list.- Parameters:
locations
- list of locations of any type- Returns:
- list of village dtos
-
toLocationPreviewDto
LocationPreviewDto toLocationPreviewDto(Location location)
-
toVillageCreationDto
VillageCreationDto toVillageCreationDto(Village village)
-
toVillageExtendedInfoDto
VillageExtendedInfoDto toVillageExtendedInfoDto(Village village)
-
toFacilityCreationDto
FacilityCreationDto toFacilityCreationDto(Facility facility)
-
toFacilityExtendedInfoDto
FacilityExtendedInfoDto toFacilityExtendedInfoDto(Facility facility)
-
toSectorCreationDto
SectorCreationDto toSectorCreationDto(Sector sector)
-
toDistrictCreationDto
DistrictCreationDto toDistrictCreationDto(District district)
-
fromDtoToVillage
Village fromDtoToVillage(VillageCreationDto villageCreationDto)
-
fromDtoToFacility
Facility fromDtoToFacility(FacilityCreationDto facilityCreationDto)
-
fromDtoToSector
Sector fromDtoToSector(SectorCreationDto sectorCreationDto)
-
fromDtoToDistrict
District fromDtoToDistrict(DistrictCreationDto districtCreationDto)
-
toFacility
default Facility toFacility(java.lang.String facilityId)
Create Facility object with given id.- Parameters:
facilityId
- id of Facility to create- Returns:
- Facility object with given id
-
toSector
default Sector toSector(java.lang.String sectorId)
Create Sector object with given id.- Parameters:
sectorId
- id of Sector to create- Returns:
- Sector object with given id
-
toDistrict
default District toDistrict(java.lang.String districtId)
Create District object with given id.- Parameters:
districtId
- id of District to create- Returns:
- District object with given id
-
updateVillageFromDto
void updateVillageFromDto(VillageCreationDto villageCreationDto, Village village)
-
updateFacilityFromDto
void updateFacilityFromDto(FacilityCreationDto facilityCreationDto, Facility facility)
-
updateSectorFromDto
void updateSectorFromDto(SectorCreationDto sectorCreationDto, Sector sector)
-
updateDistrictFromDto
void updateDistrictFromDto(DistrictCreationDto districtCreationDto, District district)
-
-