copyWith method

BuildingInfo copyWith({
  1. Optional<String?>? buildingName,
  2. Optional<String?>? purposeName,
  3. Optional<PurposeCode?>? purposeCode,
  4. Optional<BuildingLevels?>? buildingLevels,
})

Implementation

BuildingInfo copyWith({
  Optional<String?>? buildingName,
  Optional<String?>? purposeName,
  Optional<PurposeCode?>? purposeCode,
  Optional<BuildingLevels?>? buildingLevels
}) {
  return BuildingInfo(
    buildingName: buildingName != null ? buildingName.value : this.buildingName,
    purposeName: purposeName != null ? purposeName.value : this.purposeName,
    purposeCode: purposeCode != null ? purposeCode.value : this.purposeCode,
    buildingLevels: buildingLevels != null ? buildingLevels.value : this.buildingLevels
  );
}