use of org.openstack4j.model.identity.v3.builder.GroupBuilder in project camel by apache.
the class GroupProducer method messageToGroup.
private Group messageToGroup(Message message) {
Group group = message.getBody(Group.class);
if (group == null) {
Map headers = message.getHeaders();
GroupBuilder builder = Builders.group();
ObjectHelper.notEmpty(message.getHeader(OpenstackConstants.NAME, String.class), "Name");
builder.name(message.getHeader(OpenstackConstants.NAME, String.class));
if (headers.containsKey(KeystoneConstants.DOMAIN_ID)) {
builder.domainId(message.getHeader(KeystoneConstants.DOMAIN_ID, String.class));
}
if (headers.containsKey(KeystoneConstants.DESCRIPTION)) {
builder.description(message.getHeader(KeystoneConstants.DESCRIPTION, String.class));
}
group = builder.build();
}
return group;
}
Aggregations