本文整理汇总了Java中pro.lukasgorny.dto.FilterCriteria类的典型用法代码示例。如果您正苦于以下问题:Java FilterCriteria类的具体用法?Java FilterCriteria怎么用?Java FilterCriteria使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilterCriteria类属于pro.lukasgorny.dto包,在下文中一共展示了FilterCriteria类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPlayerByCriteria
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
public Player getPlayerByCriteria(final String data, final FilterCriteria criteria) {
Player player = jsonToObject(data);
Optional<FilterCriteria> criteriaOptional = Optional.fromNullable(criteria);
if(criteriaOptional.isPresent()) {
Optional<PUBGMode> modeOptional = Optional.fromNullable(criteriaOptional.get().getMode());
Optional<PUBGRegion> regionOptional = Optional.fromNullable(criteriaOptional.get().getRegion());
Optional<PUBGSeason> seasonOptional = Optional.fromNullable(criteriaOptional.get().getSeason());
if (modeOptional.isPresent() && !regionOptional.isPresent() && !seasonOptional.isPresent()) {
filterByMode(player, criteria);
} else if (!modeOptional.isPresent() && regionOptional.isPresent() && !seasonOptional.isPresent()) {
filterByRegion(player, criteria);
} else if (!modeOptional.isPresent() && !regionOptional.isPresent() && seasonOptional.isPresent()) {
filterBySeason(player, criteria);
} else if (modeOptional.isPresent() && regionOptional.isPresent() && !seasonOptional.isPresent()) {
filterByModeAndRegion(player, criteria);
} else if (modeOptional.isPresent() && !regionOptional.isPresent() && seasonOptional.isPresent()) {
filterByModeAndSeason(player, criteria);
} else if (!modeOptional.isPresent() && regionOptional.isPresent() && seasonOptional.isPresent()) {
filterByRegionAndSeason(player, criteria);
} else if (modeOptional.isPresent() && regionOptional.isPresent() && seasonOptional.isPresent()) {
filterByRegionAndModeAndSeason(player, criteria);
}
}
return player;
}
示例2: filterByMode
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByMode(Player player, FilterCriteria criteria) {
List<Match> results = new ArrayList<>();
for (Match match : player.getMatches()) {
if(match.getMatchType().equals(criteria.getMode())) {
results.add(match);
}
}
player.setMatches(results);
return player;
}
示例3: filterByRegion
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByRegion(Player player, FilterCriteria criteria) {
List<Match> results = new ArrayList<>();
for (Match match : player.getMatches()) {
if(match.getRegion().equals(criteria.getRegion())) {
results.add(match);
}
}
player.setMatches(results);
return player;
}
示例4: filterBySeason
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterBySeason(Player player, FilterCriteria criteria) {
List<Match> results = new ArrayList<>();
for (Match match : player.getMatches()) {
if(match.getSeason().equals(criteria.getSeason().getSeasonName())) {
results.add(match);
}
}
player.setMatches(results);
return player;
}
示例5: filterByModeAndRegion
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByModeAndRegion(Player player, FilterCriteria criteria) {
List<Match> results = new ArrayList<>();
for (Match match : player.getMatches()) {
if(match.getMatchType().equals(criteria.getMode()) && match.getRegion().equals(criteria.getRegion())) {
results.add(match);
}
}
player.setMatches(results);
return player;
}
示例6: filterByModeAndSeason
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByModeAndSeason(Player player, FilterCriteria criteria) {
List<Match> results = new ArrayList<>();
for (Match match : player.getMatches()) {
if(match.getMatchType().equals(criteria.getMode()) && match.getSeason().equals(criteria.getSeason().getSeasonName())) {
results.add(match);
}
}
player.setMatches(results);
return player;
}
示例7: filterByRegionAndSeason
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByRegionAndSeason(Player player, FilterCriteria criteria) {
List<Match> results = new ArrayList<>();
for (Match match : player.getMatches()) {
if(match.getRegion().equals(criteria.getRegion()) && match.getSeason().equals(criteria.getSeason().getSeasonName())) {
results.add(match);
}
}
player.setMatches(results);
return player;
}
示例8: filterByRegionAndModeAndSeason
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByRegionAndModeAndSeason(Player player, FilterCriteria criteria) {
List<Match> results = new ArrayList<>();
for (Match match : player.getMatches()) {
if(match.getRegion().equals(criteria.getRegion()) && match.getMatchType().equals(criteria.getMode())
&& match.getSeason().equals(criteria.getSeason().getSeasonName())) {
results.add(match);
}
}
player.setMatches(results);
return player;
}
示例9: filterByModeAndSeason
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByModeAndSeason(Player player, FilterCriteria criteria) {
player.setMatches(player.getMatches().stream()
.filter(match -> criteria.getSeason().getSeasonName().equals(match.getSeason()) && criteria.getMode().equals(match
.getMatchType())).collect(Collectors.toList()));
return player;
}
示例10: filterByRegionAndSeason
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByRegionAndSeason(Player player, FilterCriteria criteria) {
player.setMatches(player.getMatches().stream()
.filter(match -> criteria.getSeason().getSeasonName().equals(match.getSeason()) && criteria.getRegion()
.equals(match.getRegion()))
.collect(Collectors.toList()));
return player;
}
示例11: filterByRegionAndModeAndSeason
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByRegionAndModeAndSeason(Player player, FilterCriteria criteria) {
player.setMatches(player.getMatches().stream()
.filter(match -> criteria.getSeason().getSeasonName().equals(match.getSeason()) && criteria.getRegion()
.equals(match.getRegion())
&& criteria.getMode().equals(match.getMatchType())).collect(Collectors.toList()));
return player;
}
示例12: getByNickname
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
@Override
public Player getByNickname(@Nonnull final String nickname, final FilterCriteria criteria) {
String data = httpService.executeGetByNicknameAction(nickname);
return playerDataFilterService.getPlayerByCriteria(data, criteria);
}
示例13: getBySteamID
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
@Override
public Player getBySteamID(@Nonnull final String steamID, final FilterCriteria criteria) {
String data = httpService.executeGetBySteamIDAction(steamID);
return playerDataFilterService.getPlayerByCriteria(data, criteria);
}
示例14: filterByMode
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByMode(Player player, FilterCriteria criteria) {
player.setMatches(player.getMatches().stream().filter(match -> criteria.getMode().equals(match.getMatchType())).collect(Collectors.toList()));
return player;
}
示例15: filterByRegion
import pro.lukasgorny.dto.FilterCriteria; //导入依赖的package包/类
private Player filterByRegion(Player player, FilterCriteria criteria) {
player.setMatches(player.getMatches().stream().filter(match -> criteria.getRegion().equals(match.getRegion())).collect(Collectors.toList()));
return player;
}