require 'common/errors' class Domain @domain = nil def initialize(domain) if domain.empty? then msg = "domain cannot be empty" raise InvalidDomainError.new(msg) end @domain = domain end def to_s() return @domain end def ==(other) return self.to_s() == other.to_s() end def <=>(other) return self.to_s() <=> other.to_s() end end