package fr.ippon.tatami.domain;
import java.io.Serializable;
/**
* A domain is a domain name (e.g. "ippon.fr"), and represents a company.
*/
public class Domain implements Serializable, Comparable<Domain> {
private String name;
private int numberOfUsers;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getNumberOfUsers() {
return numberOfUsers;
}
public void setNumberOfUsers(int numberOfUsers) {
this.numberOfUsers = numberOfUsers;
}
@Override
public int compareTo(Domain other) {
return this.name.compareTo(other.name);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
} else if (o == null || getClass() != o.getClass()) {
return false;
}
Domain domain = (Domain) o;
return name.equals(domain.name);
}
@Override
public int hashCode() {
return name.hashCode();
}
@Override
public String toString() {
return "Domain{" +
"name='" + name + '\'' +
", numberOfUsers=" + numberOfUsers +
'}';
}
}