/** * Bind this key to a value. * * @param value The value to bind this key to. * @return A bound value. */ public TypedEntry<A> bindValue(A value) { return new TypedEntry<A>(this, value); }
/** * @param entries the list of typed entries * @return a newly built <code>TypedMap</code> from a list of keys and values. */ public static TypedMap create(TypedEntry<?>... entries) { return empty.putAll(entries); } }
/** * Update the map with several entries, returning a new instance of the map. * * @param entries The new entries to add to the map. * @return A new instance of the map with the new entries added. */ public TypedMap putAll(TypedEntry<?>... entries) { play.api.libs.typedmap.TypedMap newUnderlying = underlying; for (TypedEntry<?> e : entries) { newUnderlying = newUnderlying.updated(((TypedKey<Object>) e.key()).asScala(), e.value()); } return new TypedMap(newUnderlying); }
/** * Update the map with the given key and value, returning a new instance of the map. * * @param key The key to set. * @param value The value to use. * @param <A> The type of value. * @return A new instance of the map with the new entry added. */ public <A> TypedMap put(TypedKey<A> key, A value) { return new TypedMap(underlying.updated(key.asScala(), value)); }
/** * Creates a TypedKey with the given name. * * @param displayName The name to display when printing this key. * @param <A> The type of value this key is associated with. * @return A fresh key. */ public static <A> TypedKey<A> create(String displayName) { return new TypedKey<>(TypedKey$.MODULE$.apply(displayName)); }
/** * Add an attribute to the request. * * @param key The key of the attribute to add. * @param value The value of the attribute to add. * @param <T> The type of the attribute to add. * @return the request builder with extra attribute */ public <T> RequestBuilder attr(TypedKey<T> key, T value) { req = req.addAttr(key.asScala(), value); return this; }
/** * Update the request attributes. This replaces all existing attributes. * * @param newAttrs The attribute entries to add. * @return the request builder with extra attributes set. */ public RequestBuilder attrs(TypedMap newAttrs) { req = req.withAttrs(newAttrs.asScala()); return this; }
/** * Update the map with several entries, returning a new instance of the map. * * @param entries The new entries to add to the map. * @return A new instance of the map with the new entries added. */ public TypedMap putAll(TypedEntry<?>... entries) { play.api.libs.typedmap.TypedMap newUnderlying = underlying; for (TypedEntry<?> e : entries) { newUnderlying = newUnderlying.updated(((TypedKey<Object>) e.key()).asScala(), e.value()); } return new TypedMap(newUnderlying); }
/** * Update the map with the given key and value, returning a new instance of the map. * * @param key The key to set. * @param value The value to use. * @param <A> The type of value. * @return A new instance of the map with the new entry added. */ public <A> TypedMap put(TypedKey<A> key, A value) { return new TypedMap(underlying.updated(key.asScala(), value)); }
/** * Bind this key to a value. * * @param value The value to bind this key to. * @return A bound value. */ public TypedEntry<A> bindValue(A value) { return new TypedEntry<A>(this, value); }
/** * @param entries the list of typed entries * @return a newly built <code>TypedMap</code> from a list of keys and values. */ public static TypedMap create(TypedEntry<?>... entries) { return empty.putAll(entries); } }
/** * Creates a TypedKey without a name. * * @param <A> The type of value this key is associated with. * @return A fresh key. */ public static <A> TypedKey<A> create() { return new TypedKey<>(TypedKey$.MODULE$.apply()); }
/** * Add an attribute to the request. * * @param key The key of the attribute to add. * @param value The value of the attribute to add. * @param <T> The type of the attribute to add. * @return the request builder with extra attribute */ public <T> RequestBuilder attr(TypedKey<T> key, T value) { req = req.addAttr(key.asScala(), value); return this; }
/** * Update the map with several entries, returning a new instance of the map. * * @param entries The new entries to add to the map. * @return A new instance of the map with the new entries added. */ public TypedMap putAll(TypedEntry<?>... entries) { play.api.libs.typedmap.TypedMap newUnderlying = underlying; for (TypedEntry<?> e : entries) { newUnderlying = newUnderlying.updated(((TypedKey<Object>) e.key()).asScala(), e.value()); } return new TypedMap(newUnderlying); }
/** * Update the map with the given key and value, returning a new instance of the map. * * @param key The key to set. * @param value The value to use. * @param <A> The type of value. * @return A new instance of the map with the new entry added. */ public <A> TypedMap put(TypedKey<A> key, A value) { return new TypedMap(underlying.updated(key.asScala(), value)); }
/** * Bind this key to a value. * * @param value The value to bind this key to. * @return A bound value. */ public TypedEntry<A> bindValue(A value) { return new TypedEntry<A>(this, value); }
/** * @param entries the list of typed entries * @return a newly built <code>TypedMap</code> from a list of keys and values. */ public static TypedMap create(TypedEntry<?>... entries) { return empty.putAll(entries); } }
/** * Creates a TypedKey with the given name. * * @param displayName The name to display when printing this key. * @param <A> The type of value this key is associated with. * @return A fresh key. */ public static <A> TypedKey<A> create(String displayName) { return new TypedKey<>(TypedKey$.MODULE$.apply(displayName)); }
/** * Removes keys from the map, returning a new instance of the map. * * @param keys The keys to remove. * @return A new instance of the map with the entries removed. */ public TypedMap remove(TypedKey<?>... keys) { play.api.libs.typedmap.TypedMap newUnderlying = underlying; for (TypedKey<?> k : keys) { newUnderlying = newUnderlying.$minus(Scala.varargs(k.asScala())); } return new TypedMap(newUnderlying); }
/** * Removes keys from the map, returning a new instance of the map. * * @param keys The keys to remove. * @return A new instance of the map with the entries removed. */ public TypedMap remove(TypedKey<?>... keys) { play.api.libs.typedmap.TypedMap newUnderlying = underlying; for (TypedKey<?> k : keys) { newUnderlying = newUnderlying.$minus(Scala.varargs(k.asScala())); } return new TypedMap(newUnderlying); }