You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
527 B
21 lines
527 B
package com.rental.crawler.strategy;
|
|
|
|
public class RatingAnalysisStrategy implements AnalysisStrategy {
|
|
@Override
|
|
public String getStrategyName() {
|
|
return "RatingAnalysis";
|
|
}
|
|
|
|
@Override
|
|
public boolean analyze(String input) {
|
|
if (input == null || input.isEmpty()) {
|
|
return false;
|
|
}
|
|
try {
|
|
double rating = Double.parseDouble(input);
|
|
return rating >= 7.0;
|
|
} catch (NumberFormatException e) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|