public final class Predicates extends Object
HandlerInput.| Modifier and Type | Method and Description |
|---|---|
static Predicate<HandlerInput> |
canFulfillIntentName(String intentName)
Returns a predicate that returns to true if the incoming request is an
CanFulfillIntentRequest
for the given intent name. |
static Predicate<HandlerInput> |
canFulfillSlotValue(String slotName,
String slotValue)
Returns a predicate that returns to true if the incoming request is an
CanFulfillIntentRequest
and contains the given slot name and value. |
static Predicate<HandlerInput> |
intentName(String intentName)
Returns a predicate that returns to true if the incoming request is an
IntentRequest
for the given intent name. |
static Predicate<HandlerInput> |
persistentAttribute(String key,
Object value)
Returns a predicate that returns to true if the persistent attributes included with the
HandlerInput
contain the expected attribute value. |
static Predicate<HandlerInput> |
requestAttribute(String key,
Object value)
Returns a predicate that returns to true if the request attributes included with the
HandlerInput
contain the expected attribute value. |
static <T extends Request> |
requestType(Class<T> requestType)
Returns a predicate that returns to true if the incoming request is an instance
of the given request class.
|
static Predicate<HandlerInput> |
selectedElementToken(String elementToken)
Returns a predicate that returns to true if the incoming request is an
ElementSelectedRequest
with the given token. |
static Predicate<HandlerInput> |
sessionAttribute(String key,
Object value)
Returns a predicate that returns to true if session attributes are included with the
HandlerInput
and contain the expected attribute value. |
static Predicate<HandlerInput> |
slotValue(String slotName,
String slotValue)
Returns a predicate that returns to true if the incoming request is an
IntentRequest
and contains the given slot name and value. |
static Predicate<HandlerInput> |
viewportProfile(ViewportProfile viewportProfile)
Returns a predicate that returns to true if the viewport profile included with
HandlerInput
contain any of the predefined viewport profiles. |
public static <T extends Request> Predicate<HandlerInput> requestType(Class<T> requestType)
T - class of the request to evaluate againstrequestType - request type to evaluate againstpublic static Predicate<HandlerInput> intentName(String intentName)
IntentRequest
for the given intent name.intentName - intent name to evaluate againstIntentRequest for the given intent namepublic static Predicate<HandlerInput> canFulfillIntentName(String intentName)
CanFulfillIntentRequest
for the given intent name.intentName - intent name to evaluate againstCanFulfillIntentRequest for the given intent namepublic static Predicate<HandlerInput> slotValue(String slotName, String slotValue)
IntentRequest
and contains the given slot name and value.slotName - expected intent slot nameslotValue - expected intent slot valueIntentRequest and contains the given slot name and valuepublic static Predicate<HandlerInput> canFulfillSlotValue(String slotName, String slotValue)
CanFulfillIntentRequest
and contains the given slot name and value.slotName - expected intent slot nameslotValue - expected intent slot valueCanFulfillIntentRequest and contains the given slot name and valuepublic static Predicate<HandlerInput> selectedElementToken(String elementToken)
ElementSelectedRequest
with the given token.elementToken - token to evaluate againstElementSelectedRequest with the given tokenpublic static Predicate<HandlerInput> requestAttribute(String key, Object value)
HandlerInput
contain the expected attribute value.key - key of the attribute to evaluatevalue - value of the attribute to evaluateHandlerInput contain the expected
attribute valuepublic static Predicate<HandlerInput> sessionAttribute(String key, Object value)
HandlerInput
and contain the expected attribute value.key - key of the attribute to evaluatevalue - value of the attribute to evaluateHandlerInput and contain the expected
attribute value.public static Predicate<HandlerInput> persistentAttribute(String key, Object value)
HandlerInput
contain the expected attribute value.key - key of the attribute to evaluatevalue - value of the attribute to evaluateHandlerInput contain the expected
attribute valuepublic static Predicate<HandlerInput> viewportProfile(ViewportProfile viewportProfile)
HandlerInput
contain any of the predefined viewport profiles.viewportProfile - key of the attribute to evaluateHandlerInput contain the expected attribute value.Copyright © 2023. All rights reserved.