MCPcopy
hub / github.com/google/guava / of

Method of

guava/src/com/google/common/collect/ImmutableSet.java:82–85  ·  view source on GitHub ↗

Returns the empty immutable set. Preferred over {@link Collections#emptySet} for code consistency, and because the return type conveys the immutability guarantee. <p><b>Performance note:</b> the instance returned is a singleton.

()

Source from the content-addressed store, hash-verified

80 * <p><b>Performance note:</b> the instance returned is a singleton.
81 */
82 @SuppressWarnings({"unchecked"}) // fully variant implementation (never actually produces any Es)
83 public static <E> ImmutableSet<E> of() {
84 return (ImmutableSet<E>) RegularImmutableSet.EMPTY;
85 }
86
87 /**
88 * Returns an immutable set containing the given element. Preferred over {@link

Callers 15

iteratorMethod · 0.95
createEntrySetMethod · 0.95
createKeySetMethod · 0.95
createEntrySetMethod · 0.95
copyOfMethod · 0.95
buildMethod · 0.95
asImmutableMethod · 0.95
createMethod · 0.95
createCellSetMethod · 0.95
createValuesMethod · 0.95

Calls 6

addMethod · 0.95
reviewMethod · 0.95
addMethod · 0.65
buildMethod · 0.45
reviewMethod · 0.45
checkArgumentMethod · 0.45

Tested by

no test coverage detected