Klasse ImmutableValueMap.Builder
java.lang.Object
org.apache.sling.testing.mock.sling.builder.ImmutableValueMap.Builder
- Umschließende Klasse:
ImmutableValueMap
Builder interface for
ImmutableValueMap.-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung@NotNull ImmutableValueMapbuild()Returns a newly-created immutable map.@NotNull ImmutableValueMap.BuilderAssociateskeywithvaluein the built map.@NotNull ImmutableValueMap.BuilderAdds the givenentryto the map, making it immutable if necessary.@NotNull ImmutableValueMap.BuilderAssociates all of the given map's keys and values in the built map.
-
Konstruktordetails
-
Builder
public Builder()
-
-
Methodendetails
-
put
@NotNull public @NotNull ImmutableValueMap.Builder put(@NotNull @NotNull String key, @NotNull @NotNull Object value) Associateskeywithvaluein the built map. Duplicate keys are not allowed, and will causebuild()to fail.- Parameter:
key- Keyvalue- value- Gibt zurück:
- this
-
put
@NotNull public @NotNull ImmutableValueMap.Builder put(@NotNull @NotNull Map.Entry<String, Object> entry) Adds the givenentryto the map, making it immutable if necessary. Duplicate keys are not allowed, and will causebuild()to fail.- Parameter:
entry- Entry- Gibt zurück:
- this
-
putAll
@NotNull public @NotNull ImmutableValueMap.Builder putAll(@NotNull @NotNull Map<String, Object> value) Associates all of the given map's keys and values in the built map. Duplicate keys are not allowed, and will causebuild()to fail.- Parameter:
value- Value- Gibt zurück:
- this
- Löst aus:
NullPointerException- if any key or value inmapis null
-
build
Returns a newly-created immutable map.- Gibt zurück:
- ImmutableValueMap
- Löst aus:
IllegalArgumentException- if duplicate keys were added
-