org.unlaxer.jaddress.parser.DebugStatuses Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of japanese-address-parser Show documentation
Show all versions of japanese-address-parser Show documentation
a simplejapanese address parser
The newest version!
package org.unlaxer.jaddress.parser;
import java.util.List;
import java.util.stream.Collectors;
import io.vavr.collection.Stream;
public class DebugStatuses{
//make public for JSONIC::encode
public final List debugStatuses;
final String underScoredDebugStatus;
public DebugStatuses(String underScoredDebugStatus) {
super();
this.underScoredDebugStatus = underScoredDebugStatus;
debugStatuses = from(underScoredDebugStatus);
}
public static List from(String underScoredDebugStatus){
String[] degbugStatuses = underScoredDebugStatus.split("_");
List collect = Stream.of(degbugStatuses)
.map(DebugStatus::new)
.collect(Collectors.toList());
return collect;
}
public DebugStatuses(List extends ResolverResultHolder> partialParsingResults) {
debugStatuses = partialParsingResults.stream()
.map(DebugStatus::new)
.collect(Collectors.toList());
underScoredDebugStatus = toString(partialParsingResults);
}
public static String toString(List extends ResolverResultHolder> partialParsingResults) {
return partialParsingResults.stream()
.map(ResolverResultHolder::toHyphonedHexes)
.collect(Collectors.joining("_"));
}
public List debugStatuses() {
return debugStatuses;
}
public String underScoredDebugStatus() {
return underScoredDebugStatus;
}
@Override
public String toString() {
return underScoredDebugStatus;
}
public boolean allMatchParsingState(ParsingState parsingState) {
return debugStatuses.stream()
.allMatch(debugStatus->debugStatus.hasParsingState(parsingState));
}
public boolean anyMatchParsingState(ParsingState parsingState) {
return debugStatuses.stream()
.anyMatch(debugStatus->debugStatus.hasParsingState(parsingState));
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy