test_class.declarator: ITEM_NAME = "Item1"
test_class.modifier: private static final
test_class.original_string: private static final String ITEM_NAME = "Item1";
test_class.type: String
test_class.var_name: ITEM_NAME
test_class.declarator: STATE_DESCRIPTION_PROVIDER_DEFAULT_SERVICE_RANKING = 0
test_class.modifier: private static final
test_class.original_string: private static final int STATE_DESCRIPTION_PROVIDER_DEFAULT_SERVICE_RANKING = 0;
test_class.type: int
test_class.var_name: STATE_DESCRIPTION_PROVIDER_DEFAULT_SERVICE_RANKING
test_class.declarator: STATE_DESCRIPTION_PROVIDER_DEFAULT_MIN_VALUE = BigDecimal.ZERO
test_class.modifier: private static final
test_class.original_string: private static final BigDecimal STATE_DESCRIPTION_PROVIDER_DEFAULT_MIN_VALUE = BigDecimal.ZERO;
test_class.type: BigDecimal
test_class.var_name: STATE_DESCRIPTION_PROVIDER_DEFAULT_MIN_VALUE
test_class.declarator: STATE_DESCRIPTION_PROVIDER_DEFAULT_MAX_VALUE = BigDecimal.ZERO
test_class.modifier: private static final
test_class.original_string: private static final BigDecimal STATE_DESCRIPTION_PROVIDER_DEFAULT_MAX_VALUE = BigDecimal.ZERO;
test_class.type: BigDecimal
test_class.var_name: STATE_DESCRIPTION_PROVIDER_DEFAULT_MAX_VALUE
test_class.declarator: STATE_DESCRIPTION_PROVIDER_DEFAULT_STEP = BigDecimal.ZERO
test_class.modifier: private static final
test_class.original_string: private static final BigDecimal STATE_DESCRIPTION_PROVIDER_DEFAULT_STEP = BigDecimal.ZERO;
test_class.type: BigDecimal
test_class.var_name: STATE_DESCRIPTION_PROVIDER_DEFAULT_STEP
test_class.declarator: STATE_DESCRIPTION_PROVIDER_DEFAULT_PATTERN = "pattern1"
test_class.modifier: private static final
test_class.original_string: private static final String STATE_DESCRIPTION_PROVIDER_DEFAULT_PATTERN = "pattern1";
test_class.type: String
test_class.var_name: STATE_DESCRIPTION_PROVIDER_DEFAULT_PATTERN
test_class.declarator: STATE_DESCRIPTION_PROVIDER_DEFAULT_IS_READONLY = Boolean.FALSE
test_class.modifier: private static final
test_class.original_string: private static final Boolean STATE_DESCRIPTION_PROVIDER_DEFAULT_IS_READONLY = Boolean.FALSE;
test_class.type: Boolean
test_class.var_name: STATE_DESCRIPTION_PROVIDER_DEFAULT_IS_READONLY
test_class.declarator: STATE_DESCRIPTION_PROVIDER_DEFAULT_OPTIONS = Collections.emptyList()
test_class.modifier: private static final
test_class.original_string: private static final List<StateOption> STATE_DESCRIPTION_PROVIDER_DEFAULT_OPTIONS = Collections.emptyList();
test_class.type: List<StateOption>
test_class.var_name: STATE_DESCRIPTION_PROVIDER_DEFAULT_OPTIONS
test_class.declarator: stateDescriptionService
test_class.modifier: private
test_class.original_string: private StateDescriptionServiceImpl stateDescriptionService;
test_class.type: StateDescriptionServiceImpl
test_class.var_name: stateDescriptionService
test_class.declarator: item
test_class.modifier: private
test_class.original_string: private NumberItem item;
test_class.type: NumberItem
test_class.var_name: item
test_class.file: bundles/org.openhab.core/src/test/java/org/openhab/core/internal/service/StateDescriptionServiceImplTest.java
test_class.identifier: StateDescriptionServiceImplTest
test_case.body: @Test
      public void testServiceWithOneStateDescriptionProvider() {
          StateDescriptionFragment stateDescriptionFragment = StateDescriptionFragmentBuilder.create()
                  .withMinimum(STATE_DESCRIPTION_PROVIDER_DEFAULT_MIN_VALUE)
                  .withMaximum(STATE_DESCRIPTION_PROVIDER_DEFAULT_MAX_VALUE)
                  .withStep(STATE_DESCRIPTION_PROVIDER_DEFAULT_STEP)
                  .withPattern(STATE_DESCRIPTION_PROVIDER_DEFAULT_PATTERN)
                  .withReadOnly(STATE_DESCRIPTION_PROVIDER_DEFAULT_IS_READONLY)
                  .withOptions(STATE_DESCRIPTION_PROVIDER_DEFAULT_OPTIONS).build();
          registerStateDescriptionFragmentProvider(stateDescriptionFragment,
                  STATE_DESCRIPTION_PROVIDER_DEFAULT_SERVICE_RANKING);
  
          StateDescription stateDescription = item.getStateDescription();
  
          assertThat(stateDescription.getMinimum(), is(STATE_DESCRIPTION_PROVIDER_DEFAULT_MIN_VALUE));
          assertThat(stateDescription.getMaximum(), is(STATE_DESCRIPTION_PROVIDER_DEFAULT_MAX_VALUE));
          assertThat(stateDescription.getStep(), is(STATE_DESCRIPTION_PROVIDER_DEFAULT_STEP));
          assertThat(stateDescription.getPattern(), is(STATE_DESCRIPTION_PROVIDER_DEFAULT_PATTERN));
          assertThat(stateDescription.isReadOnly(), is(STATE_DESCRIPTION_PROVIDER_DEFAULT_IS_READONLY));
          assertThat(stateDescription.getOptions(), is(STATE_DESCRIPTION_PROVIDER_DEFAULT_OPTIONS));
      }
test_case.class_method_signature: StateDescriptionServiceImplTest.testServiceWithOneStateDescriptionProvider()
test_case.full_signature: @Test public void testServiceWithOneStateDescriptionProvider()
test_case.identifier: testServiceWithOneStateDescriptionProvider
test_case.invocations: build withOptions withReadOnly withPattern withStep withMaximum withMinimum create registerStateDescriptionFragmentProvider getStateDescription assertThat getMinimum is assertThat getMaximum is assertThat getStep is assertThat getPattern is assertThat isReadOnly is assertThat getOptions is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testServiceWithOneStateDescriptionProvider()
focal_class.declarator: stateDescriptionFragmentProviders = Collections.synchronizedSet(
              new TreeSet<StateDescriptionFragmentProvider>(new Comparator<StateDescriptionFragmentProvider>() {
                  @Override
                  public int compare(StateDescriptionFragmentProvider provider1,
                          StateDescriptionFragmentProvider provider2) {
                      return provider2.getRank().compareTo(provider1.getRank());
                  }
              }))
focal_class.modifier: private final
focal_class.original_string: private final Set<StateDescriptionFragmentProvider> stateDescriptionFragmentProviders = Collections.synchronizedSet(
              new TreeSet<StateDescriptionFragmentProvider>(new Comparator<StateDescriptionFragmentProvider>() {
                  @Override
                  public int compare(StateDescriptionFragmentProvider provider1,
                          StateDescriptionFragmentProvider provider2) {
                      return provider2.getRank().compareTo(provider1.getRank());
                  }
              }));
focal_class.type: Set<StateDescriptionFragmentProvider>
focal_class.var_name: stateDescriptionFragmentProviders
focal_class.file: bundles/org.openhab.core/src/main/java/org/openhab/core/internal/service/StateDescriptionServiceImpl.java
focal_class.identifier: StateDescriptionServiceImpl
focal_class.interfaces: implements StateDescriptionService
focal_class.class_method_signature: StateDescriptionServiceImpl.addStateDescriptionFragmentProvider(StateDescriptionFragmentProvider provider)
focal_class.full_signature: @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) public void addStateDescriptionFragmentProvider(StateDescriptionFragmentProvider provider)
focal_class.identifier: addStateDescriptionFragmentProvider
focal_class.modifiers: @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) public
focal_class.parameters: (StateDescriptionFragmentProvider provider)
focal_class.return: void
focal_class.signature: void addStateDescriptionFragmentProvider(StateDescriptionFragmentProvider provider)
focal_class.class_method_signature: StateDescriptionServiceImpl.removeStateDescriptionFragmentProvider(StateDescriptionFragmentProvider provider)
focal_class.full_signature: public void removeStateDescriptionFragmentProvider(StateDescriptionFragmentProvider provider)
focal_class.identifier: removeStateDescriptionFragmentProvider
focal_class.modifiers: public
focal_class.parameters: (StateDescriptionFragmentProvider provider)
focal_class.return: void
focal_class.signature: void removeStateDescriptionFragmentProvider(StateDescriptionFragmentProvider provider)
focal_class.class_method_signature: StateDescriptionServiceImpl.getStateDescription(String itemName, @Nullable Locale locale)
focal_class.full_signature: @Override public @Nullable StateDescription getStateDescription(String itemName, @Nullable Locale locale)
focal_class.identifier: getStateDescription
focal_class.modifiers: @Override public @Nullable
focal_class.parameters: (String itemName, @Nullable Locale locale)
focal_class.return: StateDescription
focal_class.signature: StateDescription getStateDescription(String itemName, @Nullable Locale locale)
focal_class.class_method_signature: StateDescriptionServiceImpl.getMergedStateDescriptionFragments(String itemName,
              @Nullable Locale locale)
focal_class.full_signature: private @Nullable StateDescriptionFragment getMergedStateDescriptionFragments(String itemName,
              @Nullable Locale locale)
focal_class.identifier: getMergedStateDescriptionFragments
focal_class.modifiers: private @Nullable
focal_class.parameters: (String itemName,
              @Nullable Locale locale)
focal_class.return: StateDescriptionFragment
focal_class.signature: StateDescriptionFragment getMergedStateDescriptionFragments(String itemName,
              @Nullable Locale locale)
focal_method.body: @Override
      public @Nullable StateDescription getStateDescription(String itemName, @Nullable Locale locale) {
          StateDescriptionFragment stateDescriptionFragment = getMergedStateDescriptionFragments(itemName, locale);
          return stateDescriptionFragment != null ? stateDescriptionFragment.toStateDescription() : null;
      }
focal_method.class_method_signature: StateDescriptionServiceImpl.getStateDescription(String itemName, @Nullable Locale locale)
focal_method.full_signature: @Override public @Nullable StateDescription getStateDescription(String itemName, @Nullable Locale locale)
focal_method.identifier: getStateDescription
focal_method.invocations: getMergedStateDescriptionFragments toStateDescription
focal_method.modifiers: @Override public @Nullable
focal_method.parameters: (String itemName, @Nullable Locale locale)
focal_method.return: StateDescription
focal_method.signature: StateDescription getStateDescription(String itemName, @Nullable Locale locale)