當前位置: 首頁>>代碼示例>>Java>>正文


Java MessagingItem類代碼示例

本文整理匯總了Java中com.restfb.types.webhook.messaging.MessagingItem的典型用法代碼示例。如果您正苦於以下問題:Java MessagingItem類的具體用法?Java MessagingItem怎麽用?Java MessagingItem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MessagingItem類屬於com.restfb.types.webhook.messaging包,在下文中一共展示了MessagingItem類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleMessagingItem

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
protected void handleMessagingItem(final MessagingItem messagingItem, final Map<String, String[]> params) {
	final MessagingParticipant sender = messagingItem.getSender();

	if (sender == null || Strings.isBlank(sender.getId())) {
		LOG.warn("Ignoring message with empty sender");
	} else {
		facebookMessageHandler.handleMessagingItem(messagingItem, params);
	}
}
 
開發者ID:nitroventures,項目名稱:bot4j,代碼行數:10,代碼來源:FacebookWebhookImpl.java

示例2: handleWebhookEntry

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
protected void handleWebhookEntry(final WebhookEntry webhookEntry, final Map<String, String[]> params) {
	for (final MessagingItem messagingItem : webhookEntry.getMessaging()) {
		if (messagingItem != null) {
			handleMessagingItem(messagingItem, params);
		}
	}
}
 
開發者ID:nitroventures,項目名稱:bot4j,代碼行數:8,代碼來源:FacebookWebhookImpl.java

示例3: createReceiveMessage

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Override
public ReceiveMessage createReceiveMessage(final MessagingItem messagingItem, final Map<String, String[]> params) {
	final ReceiveMessage result = new ReceiveMessage();

	final MessageItem messageItem = messagingItem.getMessage();
	result.setNativePayload(FacebookPlatformEnum.FACEBOOK, messagingItem);

	handleSender(messagingItem.getSender(), result);
	handleRecipient(messagingItem.getRecipient(), result);

	if (params != null) {
		result.getParams().putAll(params);
	}

	if (messageItem != null) {
		handleMessageItem(messageItem, result);
	}

	if (messagingItem.getPostback() != null) {
		handlePostbackItem(messagingItem.getPostback(), result);
	}

	if (messagingItem.getDelivery() != null) {
		handleDeliveryItem(messagingItem.getDelivery(), result);
	}

	if (messagingItem.getRead() != null) {
		handleReadItem(messagingItem.getRead(), result);
	}

	return result;
}
 
開發者ID:nitroventures,項目名稱:bot4j,代碼行數:33,代碼來源:FacebookReceiveMessageFactoryImpl.java

示例4: handleMessagingItem

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Override
public void handleMessagingItem(final MessagingItem messagingItem, final Map<String, String[]> params) {
	final ReceiveMessage receiveMessage = facebookReceiveMessageFactory.createReceiveMessage(messagingItem, params);

	if (receiveMessage != null) {
		messageReceiver.receive(receiveMessage);
	}
}
 
開發者ID:nitroventures,項目名稱:bot4j,代碼行數:9,代碼來源:FacebookReceiveHandlerImpl.java

示例5: testOnMessage

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnMessage() {
    MessageItem message = new MessageItem();
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setMessage(message);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onMessage(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:11,代碼來源:AbstractCallbackHandlerTests.java

示例6: testOnMessageDelivered

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnMessageDelivered() {
    DeliveryItem delivery = new DeliveryItem();
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setDelivery(delivery);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onMessageDelivered(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:11,代碼來源:AbstractCallbackHandlerTests.java

示例7: testOnMessageRead

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnMessageRead() {
    ReadItem read = new ReadItem();
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setRead(read);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onMessageRead(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:11,代碼來源:AbstractCallbackHandlerTests.java

示例8: testOnMessageEcho

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnMessageEcho() {
    MessageItem message = new MessageItem();
    message.setEcho(true);
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setMessage(message);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onMessageEcho(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:12,代碼來源:AbstractCallbackHandlerTests.java

示例9: testOnPostback

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnPostback() {
    PostbackItem postback = new PostbackItem();
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setPostback(postback);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onPostback(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:11,代碼來源:AbstractCallbackHandlerTests.java

示例10: testOnOptin

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnOptin() {
    OptinItem optin = new OptinItem();
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setOptin(optin);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onOptin(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:11,代碼來源:AbstractCallbackHandlerTests.java

示例11: testOnReferral

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnReferral() {
    ReferralItem referral = new ReferralItem();
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setReferral(referral);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onReferral(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:11,代碼來源:AbstractCallbackHandlerTests.java

示例12: testOnPayment

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnPayment() {
    PaymentItem payment = new PaymentItem();
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setPayment(payment);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onPayment(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:11,代碼來源:AbstractCallbackHandlerTests.java

示例13: testOnCheckoutUpdate

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnCheckoutUpdate() {
    CheckoutUpdateItem checkoutUpdate = new CheckoutUpdateItem();
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setCheckoutUpdate(checkoutUpdate);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onCheckoutUpdate(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:11,代碼來源:AbstractCallbackHandlerTests.java

示例14: testOnAccountLinking

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnAccountLinking() {
    AccountLinkingItem accountLinking = new AccountLinkingItem();
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setAccountLinking(accountLinking);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onAccountLinking(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:11,代碼來源:AbstractCallbackHandlerTests.java

示例15: testOnPolicyEnforcement

import com.restfb.types.webhook.messaging.MessagingItem; //導入依賴的package包/類
@Test
public void testOnPolicyEnforcement() {
    PolicyEnforcementItem policyEnforcement = new PolicyEnforcementItem();
    MessagingItem messagingItem = new MessagingItem();
    messagingItem.setPolicyEnforcement(policyEnforcement);
    WebhookObject webhookObject = createWebhookObjectWithMessagingItem(messagingItem);
    spyCallbackHandler.onCallback(messenger, webhookObject);
    verify(spyCallbackHandler, times(1)).onPolicyEnforcement(messenger, messagingItem);
    verifyNoMoreInteractions(spyCallbackHandler);
}
 
開發者ID:marsbits,項目名稱:restfbmessenger,代碼行數:11,代碼來源:AbstractCallbackHandlerTests.java


注:本文中的com.restfb.types.webhook.messaging.MessagingItem類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。