Package io.temporal.common
Class SearchAttributes
- java.lang.Object
-
- io.temporal.common.SearchAttributes
-
public final class SearchAttributes extends java.lang.Object
Immutable collection of typed search attributes. UseSearchAttributes.Builder
to create this collection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchAttributes.Builder
Builder for creating a search attribute collection.
-
Field Summary
Fields Modifier and Type Field Description static SearchAttributes
EMPTY
An empty search attribute collection.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(SearchAttributeKey<?> key)
Get whether the search attribute key exists.boolean
equals(java.lang.Object o)
<T> T
get(SearchAttributeKey<T> key)
Get a search attribute value by its key or null if not present.java.util.SortedMap<SearchAttributeKey<?>,java.lang.Object>
getUntypedValues()
Get the immutable, untyped sorted map.int
hashCode()
static SearchAttributes.Builder
newBuilder()
Create a new builder to create a search attribute collection.static SearchAttributes.Builder
newBuilder(SearchAttributes copyFrom)
Create a new builder to create a search attribute collection, copying from an existing collection.int
size()
Get the size of the collection.
-
-
-
Field Detail
-
EMPTY
public static final SearchAttributes EMPTY
An empty search attribute collection.
-
-
Method Detail
-
newBuilder
public static SearchAttributes.Builder newBuilder()
Create a new builder to create a search attribute collection.
-
newBuilder
public static SearchAttributes.Builder newBuilder(SearchAttributes copyFrom)
Create a new builder to create a search attribute collection, copying from an existing collection.
-
get
public <T> T get(SearchAttributeKey<T> key)
Get a search attribute value by its key or null if not present.- Throws:
java.lang.ClassCastException
- If the search attribute is not of the proper type for the key.
-
containsKey
public boolean containsKey(SearchAttributeKey<?> key)
Get whether the search attribute key exists.
-
size
public int size()
Get the size of the collection.
-
getUntypedValues
public java.util.SortedMap<SearchAttributeKey<?>,java.lang.Object> getUntypedValues()
Get the immutable, untyped sorted map.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-