// Path: src/main/java/com/lyubenblagoev/postfixrest/entity/Domain.java
// @Entity
// @Table(name="domains")
// public class Domain extends BaseEntity {
// 
// 	@Column(nullable = false)
// 	private String name;
// 
// 	@OneToMany(orphanRemoval = true, cascade = CascadeType.ALL, mappedBy = "domain")
// 	private List<Account> accounts = Collections.emptyList();
// 
// 	@OneToMany(orphanRemoval = true, cascade = CascadeType.ALL, mappedBy = "domain")
// 	private List<Alias> aliases = Collections.emptyList();
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public List<Account> getAccounts() {
// 		return accounts;
// 	}
// 
// 	public void setAccounts(List<Account> accounts) {
// 		this.accounts = accounts;
// 	}
// 
// 	public List<Alias> getAliases() {
// 		return aliases;
// 	}
// 
// 	public void setAliases(List<Alias> aliases) {
// 		this.aliases = aliases;
// 	}
// }


import java.util.Date;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lyubenblagoev.postfixrest.entity.Domain;
package com.lyubenblagoev.postfixrest.service.model;




public class DomainResource {

	private Long id;
	
	@JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ssZ")
	private Date created;
	
	@JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ssZ")
	private Date updated;
	
	private Boolean enabled;
	
	@NotEmpty
	@Pattern(regexp="^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,}$", message = "must be a valid domain name")
	private String name;
	
// Path: src/main/java/com/lyubenblagoev/postfixrest/entity/Domain.java
// @Entity
// @Table(name="domains")
// public class Domain extends BaseEntity {
// 
// 	@Column(nullable = false)
// 	private String name;
// 
// 	@OneToMany(orphanRemoval = true, cascade = CascadeType.ALL, mappedBy = "domain")
// 	private List<Account> accounts = Collections.emptyList();
// 
// 	@OneToMany(orphanRemoval = true, cascade = CascadeType.ALL, mappedBy = "domain")
// 	private List<Alias> aliases = Collections.emptyList();
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public List<Account> getAccounts() {
// 		return accounts;
// 	}
// 
// 	public void setAccounts(List<Account> accounts) {
// 		this.accounts = accounts;
// 	}
// 
// 	public List<Alias> getAliases() {
// 		return aliases;
// 	}
// 
// 	public void setAliases(List<Alias> aliases) {
// 		this.aliases = aliases;
// 	}
// }


// Path: src/main/java/com/lyubenblagoev/postfixrest/service/model/DomainResource.java
import java.util.Date;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lyubenblagoev.postfixrest.entity.Domain;

package com.lyubenblagoev.postfixrest.service.model;




public class DomainResource {

	private Long id;
	
	@JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ssZ")
	private Date created;
	
	@JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ssZ")
	private Date updated;
	
	private Boolean enabled;
	
	@NotEmpty
	@Pattern(regexp="^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,}$", message = "must be a valid domain name")
	private String name;
	
	public static DomainResource fromDomain(Domain domain) {