Package io.temporal.common
Class SearchAttributeKey<T>
- java.lang.Object
-
- io.temporal.common.SearchAttributeKey<T>
-
- All Implemented Interfaces:
java.lang.Comparable<SearchAttributeKey<T>>
public class SearchAttributeKey<T> extends java.lang.Object implements java.lang.Comparable<SearchAttributeKey<T>>
Representation of a typed search attribute key.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(SearchAttributeKey<T> o)
boolean
equals(java.lang.Object o)
static SearchAttributeKey<java.lang.Boolean>
forBoolean(java.lang.String name)
Create a search attribute key for a boolean attribute type.static SearchAttributeKey<java.lang.Double>
forDouble(java.lang.String name)
Create a search attribute key for a double attribute type.static SearchAttributeKey<java.lang.String>
forKeyword(java.lang.String name)
Create a search attribute key for a keyword attribute type.static SearchAttributeKey<java.util.List<java.lang.String>>
forKeywordList(java.lang.String name)
Create a search attribute key for a keyword list attribute type.static SearchAttributeKey<java.lang.Long>
forLong(java.lang.String name)
Create a search attribute key for an int attribute type.static SearchAttributeKey<java.time.OffsetDateTime>
forOffsetDateTime(java.lang.String name)
Create a search attribute key for a datetime attribute type.static SearchAttributeKey<java.lang.String>
forText(java.lang.String name)
Create a search attribute key for a text attribute type.static SearchAttributeKey<io.temporal.api.common.v1.Payload>
forUntyped(java.lang.String name)
Create a search attribute key for an untyped attribute type.java.lang.String
getName()
Get the name of the search attribute.java.lang.Class<? super T>
getValueClass()
Get the class that the search attribute value will be.java.lang.reflect.Type
getValueReflectType()
Get the reflect type that the search attribute will be.io.temporal.api.enums.v1.IndexedValueType
getValueType()
Get the search attribute value type.int
hashCode()
SearchAttributeUpdate<T>
valueSet(T value)
Create an update that sets a value for this key.SearchAttributeUpdate<T>
valueUnset()
Create an update that unsets a value for this key.
-
-
-
Method Detail
-
forText
public static SearchAttributeKey<java.lang.String> forText(java.lang.String name)
Create a search attribute key for a text attribute type.
-
forKeyword
public static SearchAttributeKey<java.lang.String> forKeyword(java.lang.String name)
Create a search attribute key for a keyword attribute type.
-
forLong
public static SearchAttributeKey<java.lang.Long> forLong(java.lang.String name)
Create a search attribute key for an int attribute type.
-
forDouble
public static SearchAttributeKey<java.lang.Double> forDouble(java.lang.String name)
Create a search attribute key for a double attribute type.
-
forBoolean
public static SearchAttributeKey<java.lang.Boolean> forBoolean(java.lang.String name)
Create a search attribute key for a boolean attribute type.
-
forOffsetDateTime
public static SearchAttributeKey<java.time.OffsetDateTime> forOffsetDateTime(java.lang.String name)
Create a search attribute key for a datetime attribute type.
-
forKeywordList
public static SearchAttributeKey<java.util.List<java.lang.String>> forKeywordList(java.lang.String name)
Create a search attribute key for a keyword list attribute type.
-
forUntyped
public static SearchAttributeKey<io.temporal.api.common.v1.Payload> forUntyped(java.lang.String name)
Create a search attribute key for an untyped attribute type.This should only be used when the server can return untyped search attributes, for example, when describing a schedule workflow action.
-
getName
public java.lang.String getName()
Get the name of the search attribute.
-
getValueType
public io.temporal.api.enums.v1.IndexedValueType getValueType()
Get the search attribute value type.
-
getValueClass
public java.lang.Class<? super T> getValueClass()
Get the class that the search attribute value will be.
-
getValueReflectType
public java.lang.reflect.Type getValueReflectType()
Get the reflect type that the search attribute will be. For all key types except keyword list, this is the same asgetValueType()
.
-
valueSet
public SearchAttributeUpdate<T> valueSet(@Nonnull T value)
Create an update that sets a value for this key.
-
valueUnset
public SearchAttributeUpdate<T> valueUnset()
Create an update that unsets a value for this key.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(SearchAttributeKey<T> o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<T>
-
-