MCPcopy Index your code
hub / github.com/google/dagger / unwrapSetKey

Method unwrapSetKey

java/dagger/internal/codegen/KeyFactory.java:421–430  ·  view source on GitHub ↗

If key's type is Set >, returns a key with type Set with the same qualifier. Otherwise returns Optional#empty().

(Key key, Class<?> wrappingClass)

Source from the content-addressed store, hash-verified

419 * <Bar>} with the same qualifier. Otherwise returns {@link Optional#empty()}.
420 */
421 Optional<Key> unwrapSetKey(Key key, Class<?> wrappingClass) {
422 if (SetType.isSet(key)) {
423 SetType setType = SetType.from(key);
424 if (!setType.isRawType() && setType.elementsAreTypeOf(wrappingClass)) {
425 return Optional.of(
426 key.toBuilder().type(setOf(setType.unwrappedElementType(wrappingClass))).build());
427 }
428 }
429 return Optional.empty();
430 }
431
432 /**
433 * If {@code key}'s type is {@code Optional<T>} for some {@code T}, returns a key with the same

Callers 1

keysMatchingRequestMethod · 0.80

Calls 11

isSetMethod · 0.95
fromMethod · 0.95
isRawTypeMethod · 0.95
elementsAreTypeOfMethod · 0.95
setOfMethod · 0.95
unwrappedElementTypeMethod · 0.95
buildMethod · 0.65
ofMethod · 0.45
typeMethod · 0.45
toBuilderMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected