mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Blog Client with Factory and Validator
This implements a simple initial blog client that covers the basic blog actions, but no deletion/removal of blogs, yet. Classes for Blogs and Blog Post Headers have been introduced along with the associated factories. A `BlogPostValidator` has been added that validates incoming blog posts. Closes #402 Closes #404
This commit is contained in:
43
briar-api/src/org/briarproject/api/blogs/BlogPostHeader.java
Normal file
43
briar-api/src/org/briarproject/api/blogs/BlogPostHeader.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package org.briarproject.api.blogs;
|
||||
|
||||
import org.briarproject.api.clients.PostHeader;
|
||||
import org.briarproject.api.identity.Author;
|
||||
import org.briarproject.api.identity.Author.Status;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class BlogPostHeader extends PostHeader {
|
||||
|
||||
@Nullable
|
||||
private final String title;
|
||||
@NotNull
|
||||
private final String teaser;
|
||||
private final boolean hasBody;
|
||||
|
||||
public BlogPostHeader(@Nullable String title, @NotNull String teaser,
|
||||
boolean hasBody, @NotNull MessageId id,
|
||||
@Nullable MessageId parentId, long timestamp,
|
||||
@NotNull Author author, @NotNull Status authorStatus,
|
||||
@NotNull String contentType, boolean read) {
|
||||
super(id, parentId, timestamp, author, authorStatus, contentType, read);
|
||||
|
||||
this.title = title;
|
||||
this.teaser = teaser;
|
||||
this.hasBody = hasBody;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getTeaser() {
|
||||
return teaser;
|
||||
}
|
||||
|
||||
public boolean hasBody() {
|
||||
return hasBody;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user