@Test public void testBuild() { final String username = "Joshua Hyde"; final URI serverAddress = URI.create("http: final String password = "password"; final UserPassProduct product = builder.setPassword(password).setServerAddress(serverAddress) .setUsername(username).build(); assertThat(product).isNotNull(); assertThat(product.getUsername()).isEqualTo(username); assertThat(product.getServerAddress().toString()).isEqualTo(serverAddress.toString()); assertThat(product.getPassword()).isEqualTo(password); }
@Override public UserPassProduct build() { for (final Attribute a : Attribute.values()) { if (!isSet(a)) { throw new IllegalStateException("Unset attribute: " + a.toString()); } } return new UserPassProductImpl(username, password, serverAddress); }
SimpleUserPassBuilder extends UserPassBuilder { @Override public UserPassProduct build() { for (final Attribute a : Attribute.values()) { if (!isSet(a)) { throw new IllegalStateException("Unset attribute: " + a.toString()); } } return new UserPassProductImpl(username, password, serverAddress); } }
SimpleUserPassBuilder extends UserPassBuilder { @Override public UserPassProduct build() { for (final Attribute a : Attribute.values()) { if (!isSet(a)) { throw new IllegalStateException("Unset attribute: " + a.toString()); } } return new UserPassProductImpl(username, password, serverAddress); }  }
SimpleUserPassBuilder extends UserPassBuilder { @Override public UserPassProduct build() { for (final Attribute a : Attribute.values()) { if (!isSet(a)) { throw new IllegalStateException("Unset attribute: " + a.toString()); } } return new UserPassProductImpl(username, password, serverAddress); }  @Override UserPassBuilder setPassword(final String password); @Override UserPassProduct build(); @Override UserPassBuilder setServerAddress(final URI serverAddress); @Override UserPassBuilder setUsername(final String username); }
SimpleUserPassBuilder extends UserPassBuilder { @Override public UserPassProduct build() { for (final Attribute a : Attribute.values()) { if (!isSet(a)) { throw new IllegalStateException("Unset attribute: " + a.toString()); } } return new UserPassProductImpl(username, password, serverAddress); }  @Override UserPassBuilder setPassword(final String password); @Override UserPassProduct build(); @Override UserPassBuilder setServerAddress(final URI serverAddress); @Override UserPassBuilder setUsername(final String username);  }