streams-dev mailing list archives

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

    https://github.com/apache/incubator-streams/pull/121#discussion_r20120956
  
    --- 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 --
    
    Can you take these commented lines out if you're not intending on using them?


---
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