private String getPatternFromEventType ( Event event ) { switch ( event . getType ( ) ) { case MESSAGE : return event . getMessage ( ) . getText ( ) ; case QUICK_REPLY : return event . getMessage ( ) . getQuickReply ( ) . getPayload ( ) ; case POSTBACK : return event . getPostback ( ) . getPayload ( ) ; default : return event . getMessage ( ) . getText ( ) ; } }
Match the pattern with different attributes based on the event type .