#Still need help with a proyect with lambda functions

1 messages · Page 1 of 1 (latest)

languid duneBOT
#

<@&987246399047479336> please have a look, thanks.

languid duneBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

stone violet
#

well what is your question exactly

spark apex
#

in the ContextInput class, you will have the withParameter method. It will request three parameters:

  1. the parameter's name: String
  2. a condition check: Predicate<String> (I don't know exactly by the context is it's really a String, but the key thing here is the Predicate)
  3. a function: Function<String, Object> (I don't know for sure how this would work thought, it's just a guess, it could probably not be an Object)
#

I guess it's a String, since s -> Integer.valueOf(s) would only work with Strings

flat mortar
#

Help with a proyect with lambda functions

dark thistle
#

that's a statement, what's is it that u want / need help on ?

dark thistle
#

looks like it creates an actual coffeeOrder with 2 param's

dark thistle
#

what's the next section of the resultobject ?

flat mortar
#

Still nedd help with a proyect with lambda functions

#

Still need help with a proyect with lambda functions

spark apex
#

In this method, you are defining how your ContextIntent will be converted in to your desired type (T)
so it's a Function<ContextIntent<T>, T>

#

@flat mortar

#

.resultObject(c -> new CoffeeOrder(c.<Integer>getParam("coffee-number"),
notice how the variable c has the method getParam, which they could only be got by the same object you setted theses params (through withParameter)

#

also, see how your getParam method has a generic behind it, it implies it's a conversion between Method -> E (where E is the method generic)

languid duneBOT
#

Closed the thread due to inactivity.

If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you 👍