View Javadoc

1   /*
2    * Copyright 2007 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.sf.jdigg.arguments;
17  
18  /**
19   * Argument to fetch a list of stories from Digg.
20   * <p>When you see "(Draft)" in the documentation, that means
21   * you may go ahead and use the feature in your programs, but
22   * be aware that the documentation or the API may change if
23   * you or other developers find errors.</p>
24   * <p>Please read this before you use the API:
25   * <a href="http://apidoc.digg.com/BasicConcepts#BePolitePlease">Be Polite, Please!</a></p>
26   * @author Philip May
27   * @since 1.0 M1
28   * @see <a href="http://apidoc.digg.com/ListStories#Arguments">Digg API - List Stories - Arguments</a>
29   */
30  public class ListStoriesArguments extends AbstractSortCountOffsetMinMaxDateArguments {
31  
32      private static final String MIN_SUBMIT_DATE_NAME = "min_submit_date";
33  
34      private static final String MAX_SUBMIT_DATE_NAME = "max_submit_date";
35  
36      // TODO: attributes 'min_promote_date', 'max_promote_date', 'domain', 'link', 'media', 'size' should be added later
37  
38      public ListStoriesArguments(String appkey) {
39          super(appkey);
40      }
41  
42      /**
43       * Get results submitted within a given time period.
44       * @param minSubmitDate Unix epoch integer
45       * @see net.sf.jdigg.util.DateUtil
46       */
47      public void setMinSubmitDate(long minSubmitDate) {
48          addArgument(MIN_SUBMIT_DATE_NAME, String.valueOf(minSubmitDate));
49      }
50  
51      /**
52       * Get results submitted within a given time period.
53       * @param maxSubmitDate Unix epoch integer
54       * @see net.sf.jdigg.util.DateUtil
55       */
56      public void setMaxSubmitDate(long maxSubmitDate) {
57          addArgument(MAX_SUBMIT_DATE_NAME, String.valueOf(maxSubmitDate));
58      }
59  
60  }