def from_obj(object_equivalence_obj): if not object_equivalence_obj: return None object_equivalence_ = ObjectEquivalence() object_equivalence_.id = object_equivalence_obj.get_id() object_equivalence_.object_references = [ObjectReference.from_obj(x) for x in object_equivalence_obj.get_object_Reference()] return object_equivalence_
def from_obj(candidate_indc_comp_obj): if not candidate_indc_comp_obj: return None candidate_indicator_composition_ = CandidateIndicatorComposition() candidate_indicator_composition_.operator = candidate_indc_comp_obj.get_operator() if len(candidate_indc_comp_obj.get_Behavior_Reference()) > 0: for behavior_reference_obj in candidate_indc_comp_obj.get_Behavior_Reference(): candidate_indicator_composition_.behavior_references.append(BehaviorReference.from_obj(behavior_reference_obj)) if len(candidate_indc_comp_obj.get_Action_Reference()) > 0: for action_reference_obj in candidate_indc_comp_obj.get_Action_Reference(): candidate_indicator_composition_.action_references.append(ActionReference.from_obj(action_reference_obj)) if len(candidate_indc_comp_obj.get_Object_Reference()) > 0: for object_reference_obj in candidate_indc_comp_obj.get_Object_Reference(): candidate_indicator_composition_.object_references.append(ObjectReference.from_obj(object_reference_obj)) if len(candidate_indc_comp_obj.get_Sub_Composition()) > 0: for sub_composition_obj in candidate_indc_comp_obj.get_Sub_Composition(): candidate_indicator_composition_.sub_compositions.append(CandidateIndicatorComposition.from_obj(sub_composition_obj)) return candidate_indicator_composition_