Skip to content

Instantly share code, notes, and snippets.

@appsoluut
Last active May 20, 2018 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save appsoluut/b15e7c7bbcc41a0c7a986f82aa986348 to your computer and use it in GitHub Desktop.
Save appsoluut/b15e7c7bbcc41a0c7a986f82aa986348 to your computer and use it in GitHub Desktop.
Article Blocks POJO examples
public interface Block {
}
@AutoValue
public abstract class TextBlock implements Block {
@SerializedName("text")
public abstract String text();
}
@AutoValue
public abstract class ImageBlock implements Block {
@SerializedName("source")
public abstract String source();
@Nullable
@SerializedName("author")
public abstract String author();
@Nullable
@SerializedName("description")
public abstract String description();
}
@AutoValue
public abstract class VideoBlock implements Block {
@SerializedName("source")
public abstract String source();
@SerializedName("thumbnail")
public abstract String thumbnail();
@SerializedName("title")
public abstract String title();
@SerializedName("duration")
public abstract int duration();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment