BundleDestinationDefinition.Builder bld = BundleDestinationDefinition.builder().withName(name)
.withConnectionString(connection).withDescription(description).withAcceptedBundleTypes(accepts);
if (refs != null) {
for (Property p : refs.getList()) {
PropertyMap ref = (PropertyMap) p;
String type = ref.getSimpleValue(BUNDLE_DEST_DEF_REF_TYPE_NAME, null);
if (type == null) {
continue;
}
BundleDestinationDefinition.ConfigRef.Type refType =
BundleDestinationDefinition.ConfigRef.Type.valueOf(type);
String context = ref.getSimpleValue(BUNDLE_DEST_DEF_REF_CONTEXT_NAME, null);
if (context == null) {
continue;
}
BundleDestinationDefinition.ConfigRef.Context refContext =
BundleDestinationDefinition.ConfigRef.Context.valueOf(context);
String refName = ref.getSimpleValue(BUNDLE_DEST_DEF_REF_NAME_NAME, null);
if (name == null) {
continue;
}
String refTargetName = ref.getSimpleValue(BUNDLE_DEST_DEF_REF_TARGET_NAME_NAME, refName);
bld.addPropertyReference(refType, refContext, refName, refTargetName);
}
}