All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.imunity.furms.ui.views.project.alarms.AlarmFormModelMapper Maven / Gradle / Ivy

There is a newer version: 4.3.1
Show newest version
/*
 * Copyright (c) 2020 Bixbit s.c. All rights reserved.
 * See LICENSE file for licensing information.
 */

package io.imunity.furms.ui.views.project.alarms;

import io.imunity.furms.domain.alarms.AlarmWithUserEmails;
import io.imunity.furms.domain.projects.ProjectId;

class AlarmFormModelMapper {
	static AlarmWithUserEmails map(ProjectId projectId, AlarmFormModel alarmFormModel){
		return AlarmWithUserEmails.builder()
			.id(alarmFormModel.id)
			.projectId(projectId)
			.projectAllocationId(alarmFormModel.allocationId)
			.name(alarmFormModel.name)
			.threshold(alarmFormModel.threshold)
			.allUsers(alarmFormModel.allUsers)
			.alarmUser(alarmFormModel.users)
			.build();
	}

	static AlarmFormModel map(AlarmWithUserEmails alarm){
		return AlarmFormModel.builder()
			.alarmId(alarm.id)
			.allocationId(alarm.projectAllocationId)
			.name(alarm.name)
			.threshold(alarm.threshold)
			.allUsers(alarm.allUsers)
			.users(alarm.alarmUserEmails)
			.build();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy