/** Like {@code topic()} but with a {@link ValueProvider}. */ public Write<T> to(ValueProvider<String> topic) { return toBuilder() .setTopicProvider(NestedValueProvider.of(topic, new TopicTranslator())) .build(); }
/** Like {@code topic()} but with a {@link ValueProvider}. */ public Read<T> fromTopic(ValueProvider<String> topic) { if (topic.isAccessible()) { // Validate. PubsubTopic.fromPath(topic.get()); } return toBuilder() .setTopicProvider(NestedValueProvider.of(topic, new TopicTranslator())) .build(); }