Skip to content

Commit 1af1555

Browse files
committed
Add JavaDoc stating that existing Terms be used for Category or Tags when using the builder.
1 parent fd09055 commit 1af1555

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/java/com/afrozaar/wordpress/wpapi/v2/model/builder/PostBuilder.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,32 @@ public PostBuilder withPingStatus(String pingStatus) {
128128
return this;
129129
}
130130

131+
/**
132+
* Add existing categories when building a post.
133+
*/
131134
public PostBuilder withCategories(List<Long> categoryIds) {
132135
this.categoryIds = categoryIds;
133136
return this;
134137
}
135138

139+
/**
140+
* Add existing tags when building a post.
141+
*/
136142
public PostBuilder withTags(List<Long> tagIds) {
137143
this.tagIds = tagIds;
138144
return this;
139145
}
140146

147+
/**
148+
* Add existing Category term items when building a post.
149+
*/
141150
public PostBuilder withCategories(Term... terms) {
142151
return withCategories(Arrays.stream(terms).map(Term::getId).collect(toList()));
143152
}
144153

154+
/**
155+
* Add existing Tag term items when building a post.
156+
*/
145157
public PostBuilder withTags(Term... tags) {
146158
return withTags(Arrays.stream(tags).map(Term::getId).collect(toList()));
147159
}

0 commit comments

Comments
 (0)