@Override protected void updateExistingEntity() { existingEntity.setDescription("This is an updated description"); }
@Override protected org.ovirt.engine.core.common.businessentities.Role getEntity(int index) { org.ovirt.engine.core.common.businessentities.Role role = new org.ovirt.engine.core.common.businessentities.Role(); role.setId(GUIDS[index]); role.setName(NAMES[index]); role.setDescription(DESCRIPTIONS[index]); role.setReadonly(false); role.setType(RoleType.ADMIN); return role; }
@Override protected Role generateNewEntity() { Role newRole = new Role(); newRole.setName("new role"); newRole.setDescription("This is a new role."); newRole.setType(RoleType.USER); newRole.setAllowsViewingChildren(false); newRole.setAppMode(ApplicationMode.AllModes); return newRole; }
@Override protected org.ovirt.engine.core.common.businessentities.Role getEntity(int index) { org.ovirt.engine.core.common.businessentities.Role role = new org.ovirt.engine.core.common.businessentities.Role(); role.setId(GUIDS[index]); role.setName(NAMES[index]); role.setDescription(DESCRIPTIONS[index]); role.setReadonly(false); role.setType(RoleType.ADMIN); return role; }
private static Role randomRole() { RandomUtils random = RandomUtils.instance(); Role role = new Role(); role.setDescription(random.nextString(10)); role.setId(Guid.newGuid()); role.setName(random.nextString(10)); return role; }
role.setDescription(model.getDescription().getEntity());
@Mapping(from = Role.class, to = org.ovirt.engine.core.common.businessentities.Role.class) public static org.ovirt.engine.core.common.businessentities.Role map(Role model, org.ovirt.engine.core.common.businessentities.Role template) { org.ovirt.engine.core.common.businessentities.Role entity = template != null ? template : new org.ovirt.engine.core.common.businessentities.Role(); if (model.isSetId()) { entity.setId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetDescription()) { entity.setDescription(model.getDescription()); } if (model.isSetMutable()) { entity.setReadonly(!model.isMutable()); } if (model.isSetAdministrative()) { entity.setType(model.isAdministrative() ? RoleType.ADMIN : RoleType.USER); } return entity; } }