@Test void fromLocalPartWithDomainStringVersionShouldThrowOnEmptyDomainPart() { assertThatThrownBy(() -> Username.fromLocalPartWithDomain("local", "")) .isInstanceOf(IllegalArgumentException.class); }
public static Username fromLocalPartWithDomain(String localPart, String domain) { Preconditions.checkNotNull(domain); return fromLocalPartWithDomain(localPart, Domain.of(domain)); }
Username { public static Username fromLocalPartWithDomain(String localPart, String domain) { Preconditions.checkNotNull(domain); return fromLocalPartWithDomain(localPart, Domain.of(domain)); } }
Username { public static Username fromLocalPartWithDomain(String localPart, String domain) { Preconditions.checkNotNull(domain); return fromLocalPartWithDomain(localPart, Domain.of(domain)); } private  Username(String localPart, Optional<Domain> domainPart); }
Username { public static Username fromLocalPartWithDomain(String localPart, String domain) { Preconditions.checkNotNull(domain); return fromLocalPartWithDomain(localPart, Domain.of(domain)); } private  Username(String localPart, Optional<Domain> domainPart); static Username of(String username); static Username fromLocalPartWithDomain(String localPart, String domain); static Username fromLocalPartWithDomain(String localPart, Domain domain); static Username fromMailAddress(MailAddress address); static Username fromLocalPartWithoutDomain(String localPart); static Username from(String localPart, Optional<String> domain); String getLocalPart(); Optional<Domain> getDomainPart(); Username withOtherDomain(Optional<Domain> domain); Username withOtherDomain(Domain domain); boolean hasDomainPart(); Username withDefaultDomain(Optional<Domain> defaultDomain); Username withDefaultDomain(Domain defaultDomain); Username withDefaultDomainFromUser(Username other); String asString(); MailAddress asMailAddress(); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString(); }
Username { public static Username fromLocalPartWithDomain(String localPart, String domain) { Preconditions.checkNotNull(domain); return fromLocalPartWithDomain(localPart, Domain.of(domain)); } private  Username(String localPart, Optional<Domain> domainPart); static Username of(String username); static Username fromLocalPartWithDomain(String localPart, String domain); static Username fromLocalPartWithDomain(String localPart, Domain domain); static Username fromMailAddress(MailAddress address); static Username fromLocalPartWithoutDomain(String localPart); static Username from(String localPart, Optional<String> domain); String getLocalPart(); Optional<Domain> getDomainPart(); Username withOtherDomain(Optional<Domain> domain); Username withOtherDomain(Domain domain); boolean hasDomainPart(); Username withDefaultDomain(Optional<Domain> defaultDomain); Username withDefaultDomain(Domain defaultDomain); Username withDefaultDomainFromUser(Username other); String asString(); MailAddress asMailAddress(); @Override final boolean equals(Object o); @Override final int hashCode(); @Override String toString(); static final int MAXIMUM_MAIL_ADDRESS_LENGTH; }