Android Open Source - Reddit-Underground Reddit Subreddit






From Project

Back to project page Reddit-Underground.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project Reddit-Underground listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
Copyright 2013 Cory Dissinger//w w w . j av a  2  s.  c  o  m

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at 

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

package com.cd.reddit.json.mapping;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

/**
 * Implements the Java bean version of the JSON found <a href="https://github.com/reddit/reddit/wiki/JSON#more">here</a>.
 * 
 * @author <a href="https://github.com/reddit/reddit/wiki/JSON#subreddit">Cory Dissinger</a>
 */

@JsonIgnoreProperties(ignoreUnknown = true)
public class RedditSubreddit extends RedditType {
  private int accountsActive;
  private int commentScoreHideMins;  
  private String description;  
  private boolean over18;
  private long subscribers;  
  private String title;
  private String url;
  
  public int getAccountsActive() {
    return accountsActive;
  }
  public void setAccountsActive(int accountsActive) {
    this.accountsActive = accountsActive;
  }
  public int getCommentScoreHideMins() {
    return commentScoreHideMins;
  }
  public void setCommentScoreHideMins(int commentScoreHideMins) {
    this.commentScoreHideMins = commentScoreHideMins;
  }
  public String getDescription() {
    return description;
  }
  public void setDescription(String description) {
    this.description = description;
  }
  public boolean isOver18() {
    return over18;
  }
  public void setOver18(boolean over18) {
    this.over18 = over18;
  }
  public long getSubscribers() {
    return subscribers;
  }
  public void setSubscribers(long subscribers) {
    this.subscribers = subscribers;
  }
  public String getTitle() {
    return title;
  }
  public void setTitle(String title) {
    this.title = title;
  }
  public String getUrl() {
    return url;
  }
  public void setUrl(String url) {
    this.url = url;
  }
  
  /**
   * The 'url' JSON attribute is '/r/subreddit-name', so for the use case where we just want
   * to get the subreddit name we can call this helper method.
   * 
   * @return The string representing just the subreddit name
   */
  public String getSubredditName(){
    return url.substring(3, url.length() - 1);
  }
  
  @Override
  public String toString() {
    StringBuilder builder = new StringBuilder();
    builder.append("RedditSubreddit [accountsActive=");
    builder.append(accountsActive);
    builder.append(", commentScoreHideMins=");
    builder.append(commentScoreHideMins);
    builder.append(", description=");
    builder.append(description);
    builder.append(", over18=");
    builder.append(over18);
    builder.append(", subscribers=");
    builder.append(subscribers);
    builder.append(", title=");
    builder.append(title);
    builder.append(", url=");
    builder.append(url);
    builder.append("]");
    return builder.toString();
  }  
}




Java Source Code List

com.cd.reddit.RedditException.java
com.cd.reddit.Reddit.java
com.cd.reddit.exception.RedditRateLimitException.java
com.cd.reddit.http.QueryBuilder.java
com.cd.reddit.http.RedditRequestor.java
com.cd.reddit.http.util.RedditApiParameterConstants.java
com.cd.reddit.http.util.RedditApiResourceConstants.java
com.cd.reddit.http.util.RedditRequestInput.java
com.cd.reddit.http.util.RedditRequestResponse.java
com.cd.reddit.json.jackson.RedditJacksonManager.java
com.cd.reddit.json.jackson.RedditJsonParser.java
com.cd.reddit.json.mapping.RedditAccount.java
com.cd.reddit.json.mapping.RedditComment.java
com.cd.reddit.json.mapping.RedditJsonMessage.java
com.cd.reddit.json.mapping.RedditLink.java
com.cd.reddit.json.mapping.RedditMessage.java
com.cd.reddit.json.mapping.RedditMore.java
com.cd.reddit.json.mapping.RedditSubreddit.java
com.cd.reddit.json.mapping.RedditType.java
com.cd.reddit.json.util.RedditComments.java
com.cd.reddit.json.util.RedditJsonConstants.java
com.mikedaguillo.reddit_underground.ApplicationTest.java
com.mikedaguillo.reddit_underground.ImageViewScreen.java
com.mikedaguillo.reddit_underground.LoginScreen.java
com.mikedaguillo.reddit_underground.ManualEntryScreen.java
com.mikedaguillo.reddit_underground.RedditInstance.java
com.mikedaguillo.reddit_underground.RedditListItem.java
com.mikedaguillo.reddit_underground.SavedSubredditsScreen.java
com.mikedaguillo.reddit_underground.StartScreen.java
com.mikedaguillo.reddit_underground.SubredditsSelectionScreen.java
com.mikedaguillo.reddit_underground.TinyDB.java
com.mikedaguillo.reddit_underground.SubredditDatabaseModel.SubredditsDatabaseHelper.java