streams-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From steveblackmon <...@git.apache.org>
Subject [GitHub] incubator-streams pull request: move type conversion and date form...
Date Tue, 11 Nov 2014 18:50:18 GMT
Github user steveblackmon commented on a diff in the pull request:

    https://github.com/apache/incubator-streams/pull/121#discussion_r20170852
  
    --- Diff: streams-contrib/streams-provider-twitter/src/main/java/org/apache/streams/twitter/provider/TwitterEventClassifier.java
---
    @@ -72,4 +69,31 @@ else if ( objectNode.findValue("location") != null && objectNode.findValue("user
             else
                 return Tweet.class;
         }
    +    public static ActivitySerializer bestSerializer( String json ) {
    +
    +        Preconditions.checkNotNull(json);
    +        Preconditions.checkArgument(StringUtils.isNotEmpty(json));
    +
    +        ObjectNode objectNode;
    +        try {
    +            objectNode = (ObjectNode) mapper.readTree(json);
    +        } catch (IOException e) {
    +            e.printStackTrace();
    +            return null;
    +        }
    +
    +        if( objectNode.findValue("retweeted_status") != null && objectNode.get("retweeted_status")
!= null)
    +            return TwitterJsonRetweetActivitySerializer.getInstance();
    +        else if( objectNode.findValue("delete") != null )
    +            return TwitterJsonDeleteActivitySerializer.getInstance();
    +//        else if( objectNode.findValue("friends") != null ||
    --- End diff --
    
    I intend to, but not in this PR.  I'll delete for now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message