title: How shall I convert String to Writable object in my Hadoop Mapper
body: <p>This is a very crazy problem hitting me since a few hours.</p>
  
  <p>Any help would be highly appreciated.</p>
  
  <p>I am not able to </p>
  
  <pre><code>public void map(Object key, Text value, Context context) throws IOException, InterruptedException {
        if (!value.toString().equals("")) {
  
  
  
            Gson gson = new Gson();
            Boolean flag = true;
            System.out.println("000000000"); 
            while(flag){
                Text tweetId = new Text();
                Tweet tweet = gson.fromJson(value.toString(), Tweet.class);
                tweetId.set(tweet.getRetweetStatus().getUser().getId().toString());
                System.out.println("Tweet objects:" + tweet.toString());
                System.out.println("ParentUserId:" + tweetId);
                context.write(tweetId, tweet);
                flag = false;
            }
            Text tweetId = new Text();
            Tweet tweet = gson.fromJson(value.toString(), Tweet.class);
            tweetId.set(tweet.getUser().getId().toString());
            String tweetReverse = (Object) tweet.getRetweetStatus().getUser().getId();
  
            System.out.println("Reverse::");
            System.out.println("Tweet objects:" + tweetReverse);
            System.out.println("ParentUserId:" + tweetId);
  
            context.write(tweetId, tweetReverse);
        }
      }
  </code></pre>
  
  <p>I want to convert the String object 'tweetReverse' to Writable so that I can use it the context.write function.</p>
  
  <p>Is this even possible?</p>
  
  <p>What shall I do if not convert?</p>
  
  <p>If I change the generic type to String, then also I get problems in the class which extends Writable to reading and writing values.</p>
  
  <p>Any help would be highly appreciated.</p>
  
  <p>Thanks a lot in advance.</p>