Search in sources :

Example 31 with Options

use of com.b2international.commons.options.Options in project snow-owl by b2ihealthcare.

the class SnomedReferenceSetMemberConverter method expandReferencedComponent.

private void expandReferencedComponent(List<SnomedReferenceSetMember> results) {
    if (expand().containsKey(SnomedReferenceSetMember.Expand.REFERENCED_COMPONENT)) {
        Options expandOptions = expand().get(SnomedReferenceSetMember.Expand.REFERENCED_COMPONENT, Options.class);
        final Multimap<String, SnomedReferenceSetMember> referencedComponentIdToMemberMap = collectReferencedComponentIds(results);
        final Multimap<ComponentCategory, String> componentCategoryToIdMap = collectReferencedComponentCategories(referencedComponentIdToMemberMap);
        for (ComponentCategory category : componentCategoryToIdMap.keySet()) {
            expandComponentCategory(expandOptions, referencedComponentIdToMemberMap, componentCategoryToIdMap, category);
        }
    }
}
Also used : SnomedReferenceSetMember(com.b2international.snowowl.snomed.core.domain.refset.SnomedReferenceSetMember) Options(com.b2international.commons.options.Options) ComponentCategory(com.b2international.snowowl.core.terminology.ComponentCategory)

Example 32 with Options

use of com.b2international.commons.options.Options in project snow-owl by b2ihealthcare.

the class SearchResourceRequestTest method specialOptionKeyWithExtraParenthesis.

@Test
public void specialOptionKeyWithExtraParenthesis() throws Exception {
    final Options options = Options.builder().put(OptionKey.SPECIAL, "@field(value (extra))").build();
    final Options actual = SearchResourceRequest.processSpecialOptionKey(options, OptionKey.SPECIAL);
    assertEquals(Options.builder().put("FIELD", "value (extra)").build(), actual);
}
Also used : Options(com.b2international.commons.options.Options) Test(org.junit.Test)

Example 33 with Options

use of com.b2international.commons.options.Options in project snow-owl by b2ihealthcare.

the class SearchResourceRequestTest method specialOptionKeyWithNonExpressionValue.

@Test
public void specialOptionKeyWithNonExpressionValue() throws Exception {
    final Options options = Options.builder().put(OptionKey.SPECIAL, "not an expression").build();
    final Options actual = SearchResourceRequest.processSpecialOptionKey(options, OptionKey.SPECIAL);
    assertTrue(options == actual);
}
Also used : Options(com.b2international.commons.options.Options) Test(org.junit.Test)

Example 34 with Options

use of com.b2international.commons.options.Options in project snow-owl by b2ihealthcare.

the class SearchResourceRequestTest method specialOptionKeyWithNoValue.

@Test
public void specialOptionKeyWithNoValue() throws Exception {
    final Options options = Options.builder().build();
    final Options actual = SearchResourceRequest.processSpecialOptionKey(options, OptionKey.SPECIAL);
    assertTrue(options == actual);
}
Also used : Options(com.b2international.commons.options.Options) Test(org.junit.Test)

Example 35 with Options

use of com.b2international.commons.options.Options in project snow-owl by b2ihealthcare.

the class SearchResourceRequestTest method nullSpecialOptionKey.

@Test
public void nullSpecialOptionKey() throws Exception {
    final Options options = Options.builder().build();
    final Options actual = SearchResourceRequest.processSpecialOptionKey(options, null);
    assertTrue(options == actual);
}
Also used : Options(com.b2international.commons.options.Options) Test(org.junit.Test)

Aggregations

Options (com.b2international.commons.options.Options)57 List (java.util.List)15 Collectors (java.util.stream.Collectors)14 Set (java.util.Set)13 ExtendedLocale (com.b2international.commons.http.ExtendedLocale)11 BranchContext (com.b2international.snowowl.core.domain.BranchContext)11 SnomedConcept (com.b2international.snowowl.snomed.core.domain.SnomedConcept)11 SnomedConceptRequestCache (com.b2international.snowowl.snomed.datastore.request.SnomedConceptRequestCache)11 Test (org.junit.Test)9 SnomedReferenceSetMember (com.b2international.snowowl.snomed.core.domain.refset.SnomedReferenceSetMember)8 Map (java.util.Map)8 Concepts (com.b2international.snowowl.snomed.common.SnomedConstants.Concepts)7 SnomedConcepts (com.b2international.snowowl.snomed.core.domain.SnomedConcepts)7 BadRequestException (com.b2international.commons.exceptions.BadRequestException)6 ResourceURI (com.b2international.snowowl.core.ResourceURI)6 RepositoryContext (com.b2international.snowowl.core.domain.RepositoryContext)6 SnomedRelationship (com.b2international.snowowl.snomed.core.domain.SnomedRelationship)6 SnomedRequests (com.b2international.snowowl.snomed.datastore.request.SnomedRequests)6 Multimaps (com.google.common.collect.Multimaps)6 Collection (java.util.Collection)6