default DashboardEntity createOrUpdate(DashboardEntity dashboardEntity, User user) throws EntityNotFoundException { Preconditions.checkNotNull(dashboardEntity, "DashboardEntity should not be null"); if (dashboardEntity.getUuid() == null) { Preconditions.checkArgument(dashboardEntity.getAuthor() == null, "author is immutable"); dashboardEntity.setAuthor(user.getName()); return create(dashboardEntity); } else { return update(dashboardEntity, user); } } }