/** * Find a value, if present, for the given metadata key * * @param key to search for * @return optional of the a value for the given key */ public Optional<String> find(String key) { Preconditions.checkNotNull(key); return findStream(key).findFirst(); }
/** * Find a value, if present, for the given metadata key * * @param key to search for * @return optional of the a value for the given key */ public Optional<String> find(String key) { Preconditions.checkNotNull(key); return findStream(key).findFirst(); }
/** * Find all values, if present, for the given metadata key * * @param key to search for * @return list of all the values for the given key */ public Set<String> findAll(String key) { Preconditions.checkNotNull(key); return findStream(key).collect(Collectors.toSet()); }
/** * Find all values, if present, for the given metadata key * * @param key to search for * @return list of all the values for the given key */ public Set<String> findAll(String key) { Preconditions.checkNotNull(key); return findStream(key).collect(Collectors.toSet()); }
/** * Find a value, if present, for the given metadata key(s) * * @param key to search for * @return optional of the a value for any of the given keys */ public Optional<String> find(String key, String... more) { Set<String> keys = ImmutableSet.<String>builder().add(key).addAll(Arrays.asList(more)).build(); return findStream(keys).findFirst(); }
/** * Find a value, if present, for the given metadata key(s) * * @param key to search for * @return optional of the a value for any of the given keys */ public Optional<String> find(String key, String... more) { Set<String> keys = ImmutableSet.<String>builder().add(key).addAll(Arrays.asList(more)).build(); return findStream(keys).findFirst(); }