use of org.mitre.stix.indicator_2.Indicator in project metron by apache.
the class StixExtractor method getObservables.
public List<Observable> getObservables(STIXPackage stixPackage) {
List<Observable> ret = new ArrayList<>();
Observables observables = stixPackage.getObservables();
if (observables != null) {
for (Observable o : observables.getObservables()) {
ret.add(o);
}
}
if (stixPackage.getIndicators() != null) {
if (stixPackage.getIndicators().getIndicators() != null) {
List<IndicatorBaseType> indicators = stixPackage.getIndicators().getIndicators();
int indicatorCount = indicators.size();
for (int i = 0; i < indicatorCount; i++) {
Indicator indicator = (Indicator) indicators.get(i);
if (indicator.getObservable() != null) {
ret.add(indicator.getObservable());
}
}
}
}
return ret;
}
Aggregations