MethodFactory.java :  » Widget » twidgie » com » twidgie » twitter » method » Android Open Source

Android Open Source » Widget » twidgie 
twidgie » com » twidgie » twitter » method » MethodFactory.java
package com.twidgie.twitter.method;

public class MethodFactory {
  private static final String FRIENDS_TIMELINE_URL = "http://twitter.com/statuses/friends_timeline.xml";
  private static final String DIRECT_MESSAGES_URL = "http://twitter.com/direct_messages.xml";
  private static final String MENTIONS_URL = "http://twitter.com/statuses/mentions.xml";

  private MethodFactory() {

  }

  protected static final Method createFriendsTimeline() {
    return createMethodFactory().getNewFriendsTimeline();
  }

  protected static final Method createDirectMessages() {
    return createMethodFactory().getNewDirectMessages();
  }

  protected static final Method createMentions() {
    return createMethodFactory().getNewMentions();
  }

  private static MethodFactory createMethodFactory() {
    return new MethodFactory();
  }

  private Method getNewFriendsTimeline() {
    return new FriendsTimeline();
  }

  private Method getNewDirectMessages() {
    return new DirectTimeline();
  }

  private Method getNewMentions() {
    return new Mentions();
  }

  private final class FriendsTimeline implements Method {
    @Override
    public String getUrl() {
      return FRIENDS_TIMELINE_URL;
    }
  }

  private final class DirectTimeline implements Method {

    @Override
    public String getUrl() {
      return DIRECT_MESSAGES_URL;
    }
  }

  private final class Mentions implements Method {

    @Override
    public String getUrl() {
      return MENTIONS_URL;
    }
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.