getValue

getValue メソッドは、コールアウトの中核機能を実行し、その結果を返します。

getValue(audienceID, configData, arguments)

getValue メソッドには以下のパラメーターが必要です。

  • audienceID - オーディエンス ID を識別する値。

  • configData - コールアウトで必要な構成データのキーと値のペアによるマップ。

  • arguments - コールアウトで必要な引数。各引数は、String、Double、Date、またはこのいずれかの List です。List の引数には NULL 値を含めることができますが、例えば、String と Double を一緒に含めることはできません。

    引数タイプのチェックは、使用している実装内で行う必要があります。

getValue メソッドは、何らかの理由により失敗した場合、CalloutException を返します。

戻り値

getValue メソッドは String のリストを返します。

public List<String> getValue(AudienceId audienceId, Map<String, 
  String> configurationData, Object... arguments) throws CalloutException
{
 Long customerId = (Long) audienceId.getComponentValue("Customer");
 // now query scoreQueryUtility for the credit score of customerId
 Double score = scoreQueryUtility.query(customerId);
 String str = Double.toString(score);
 List<String> list = new LinkedList<String>();
 list.add(str);
 return list;
}