Package com.google.gerrit.server
Class PropertyMap
- java.lang.Object
-
- com.google.gerrit.server.PropertyMap
-
public class PropertyMap extends Object
Immutable map that holds a collection of random objects allowing for a type-safe retrieval.Intended to be used in
CurrentUserwhen the object is constructed during login and holds per-request state. This functionality allows plugins/extensions to contribute specific data toCurrentUserthat is unknown to Gerrit core.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPropertyMap.Builderstatic classPropertyMap.Key<T>Typed key forPropertyMap.
-
Field Summary
Fields Modifier and Type Field Description static PropertyMapEMPTYEmpty instance to be referenced once per JVM.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertyMap.Builderbuilder()Returns a newPropertyMap.Builderinstance.<T> Optional<T>get(PropertyMap.Key<T> key)Returns the requested value wrapped asOptional.static <T> PropertyMap.Key<T>key()
-
-
-
Field Detail
-
EMPTY
public static final PropertyMap EMPTY
Empty instance to be referenced once per JVM.
-
-
Method Detail
-
key
public static <T> PropertyMap.Key<T> key()
-
builder
public static PropertyMap.Builder builder()
Returns a newPropertyMap.Builderinstance.
-
get
public <T> Optional<T> get(PropertyMap.Key<T> key)
Returns the requested value wrapped asOptional.
-
-