Search in sources :

Example 1 with DynamoSubpopulation

use of org.sagebionetworks.bridge.dynamodb.DynamoSubpopulation in project BridgeServer2 by Sage-Bionetworks.

the class SubpopulationServiceTest method createSubpop.

private Subpopulation createSubpop(String name, Integer min, Integer max, String group) {
    DynamoSubpopulation subpop = new DynamoSubpopulation();
    subpop.setAppId(TEST_APP_ID);
    subpop.setName(name);
    subpop.setGuidString(BridgeUtils.generateGuid());
    Criteria criteria = Criteria.create();
    if (min != null) {
        criteria.setMinAppVersion(OperatingSystem.IOS, min);
    }
    if (max != null) {
        criteria.setMaxAppVersion(OperatingSystem.IOS, max);
    }
    if (group != null) {
        criteria.setAllOfGroups(ImmutableSet.of(group));
    }
    subpop.setCriteria(criteria);
    return subpop;
}
Also used : DynamoSubpopulation(org.sagebionetworks.bridge.dynamodb.DynamoSubpopulation) Criteria(org.sagebionetworks.bridge.models.Criteria)

Aggregations

DynamoSubpopulation (org.sagebionetworks.bridge.dynamodb.DynamoSubpopulation)1 Criteria (org.sagebionetworks.bridge.models.Criteria)1