package eu.socialsensor.framework.common.domain.feeds;

import java.util.Date;

import eu.socialsensor.framework.common.domain.Feed;

public class ListFeed extends Feed {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6876101187566475910L;
	private String owner;
	private String slug;

	public ListFeed(String owner, String slug, Date since) {
		super(since, Feed.FeedType.LIST);
		
		this.owner = owner;
		this.slug = slug;
	}

	public String getListOwner() {
		return owner;
	}
	
	public String getListSlug() {
		return slug;
	}
}

package eu.socialsensor.framework.common.domain.feeds;

import java.util.Date;

import eu.socialsensor.framework.common.domain.Feed;

public class ListFeed extends Feed {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6876101187566475910L;
	private String owner;
	private String slug;
	
	public ListFeed(String url,Date since,String id){
		super(since, Feed.FeedType.LIST);
		this.id = id;
		
		String twitterRegex = "https://twitter.com/";
		String restString = url.replace(twitterRegex, "");
		int index = restString.indexOf("/");
	
		this.owner = restString.substring(0, index);
	
		String ownerRegex = owner+"/lists/";
	
		this.slug = restString.replace(ownerRegex, "");
		
	}

	public ListFeed(String owner, String slug, Date since,String id) {
		super(since, Feed.FeedType.LIST);
		this.id = id;
		this.owner = owner;
		this.slug = slug;
	}

	public String getListOwner() {
		return owner;
	}
	
	public String getListSlug() {
		return slug;
	}
	
	public static void main(String[] args) {
		ListFeed listFeed = new ListFeed("https://twitter.com/1basil1/lists/sundance2012filmmakers",null,null);
		
	}
}

update listFeed with url in constuctor