/** * If the value to be returned by {@link StorageClientSettings#clientName()} is present, replaces * it by applying {@code mapper} to it and using the result. * * <p>If the result is null, clears the value. * * @return this {@code Builder} object * @throws NullPointerException if {@code mapper} is null */ public StorageClientSettings.Builder mapClientName(UnaryOperator<String> mapper) { return clientName(clientName().map(mapper)); }
/** * Sets the value to be returned by {@link StorageClientSettings#clientName()}. * * @return this {@code Builder} object */ public StorageClientSettings.Builder clientName(Optional<? extends String> clientName) { if (clientName.isPresent()) { return clientName(clientName.get()); } else { return clearClientName(); } }
/** * Sets the value to be returned by {@link StorageClientSettings#clientName()}. * * @return this {@code Builder} object */ public StorageClientSettings.Builder nullableClientName(@Nullable String clientName) { if (clientName != null) { return clientName(clientName); } else { return clearClientName(); } }