Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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