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
CurrentUser
when the object is constructed during login and holds per-request state. This functionality allows plugins/extensions to contribute specific data toCurrentUser
that is unknown to Gerrit core.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PropertyMap.Builder
static class
PropertyMap.Key<T>
Typed key forPropertyMap
.
-
Field Summary
Fields Modifier and Type Field Description static PropertyMap
EMPTY
Empty instance to be referenced once per JVM.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PropertyMap.Builder
builder()
Returns a newPropertyMap.Builder
instance.<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.Builder
instance.
-
get
public <T> Optional<T> get(PropertyMap.Key<T> key)
Returns the requested value wrapped asOptional
.
-
-