mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-07-04 22:37:26 +00:00
[Add] 增加PixivSearchLinkBuilder中内部属性的getter, 增加Pixiv工具类;
[Update] PixivSearchAttribute 补充Javadoc; [Add] PixivSearchLinkBuilder 增加大部分属性的getter方法; [Add] PixivUtils 增加Pixiv工具类, 并添加通过字符串参数构造PixivSearchLinkBuilder的方法;
This commit is contained in:
@ -8,6 +8,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Pixiv搜索URL构造器
|
||||
@ -26,8 +27,8 @@ public class PixivSearchLinkBuilder {
|
||||
private SearchOrder searchOrder = SearchOrder.DATE_D;
|
||||
private SearchContentOption searchContentOption = SearchContentOption.ALL;
|
||||
|
||||
private final HashSet<String> includeKeywords = new HashSet<>(0);
|
||||
private final HashSet<String> excludeKeywords = new HashSet<>(0);
|
||||
private final Set<String> includeKeywords = new HashSet<>(0);
|
||||
private final Set<String> excludeKeywords = new HashSet<>(0);
|
||||
|
||||
private int page = 1;
|
||||
|
||||
@ -161,11 +162,19 @@ public class PixivSearchLinkBuilder {
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public PixivSearchLinkBuilder setSearchArea(SearchArea searchArea) {
|
||||
this.searchArea = Objects.requireNonNull(searchArea);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SearchArea getSearchArea() {
|
||||
return searchArea;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取搜索条件.
|
||||
* @return 搜索条件内容
|
||||
@ -199,32 +208,60 @@ public class PixivSearchLinkBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public SearchMode getSearchMode() {
|
||||
return searchMode;
|
||||
}
|
||||
|
||||
public PixivSearchLinkBuilder setSearchType(SearchType searchType) {
|
||||
this.searchType = Objects.requireNonNull(searchType);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SearchType getSearchType() {
|
||||
return searchType;
|
||||
}
|
||||
|
||||
public PixivSearchLinkBuilder setSearchOrder(SearchOrder searchOrder) {
|
||||
this.searchOrder = Objects.requireNonNull(searchOrder);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SearchOrder getSearchOrder() {
|
||||
return searchOrder;
|
||||
}
|
||||
|
||||
public PixivSearchLinkBuilder setSearchContentOption(SearchContentOption searchContentOption) {
|
||||
this.searchContentOption = Objects.requireNonNull(searchContentOption);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SearchContentOption getSearchContentOption() {
|
||||
return searchContentOption;
|
||||
}
|
||||
|
||||
public PixivSearchLinkBuilder setRatioOption(RatioOption ratioOption) {
|
||||
this.ratioOption = Objects.requireNonNull(ratioOption);
|
||||
return this;
|
||||
}
|
||||
|
||||
public RatioOption getRatioOption() {
|
||||
return ratioOption;
|
||||
}
|
||||
|
||||
public PixivSearchLinkBuilder setDateRange(Date startDate, Date endDate) {
|
||||
this.startDate = startDate;
|
||||
this.endDate = endDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public PixivSearchLinkBuilder setMaxSize(int width, int height) {
|
||||
this.wgt = width;
|
||||
this.hgt = height;
|
||||
@ -245,6 +282,10 @@ public class PixivSearchLinkBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public PixivSearchLinkBuilder addExcludeKeyword(String keyword) {
|
||||
excludeKeywords.add(keyword);
|
||||
return this;
|
||||
@ -265,6 +306,14 @@ public class PixivSearchLinkBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Set<String> getIncludeKeywords() {
|
||||
return new HashSet<>(includeKeywords);
|
||||
}
|
||||
|
||||
public Set<String> getExcludeKeywords() {
|
||||
return new HashSet<>(excludeKeywords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索区域
|
||||
*/
|
||||
@ -406,5 +455,4 @@ public class PixivSearchLinkBuilder {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user