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 testMinValueMaxValueStepAndPatternTwoDescriptionProviders() {
          StateDescriptionFragment stateDescriptionFragment1 = StateDescriptionFragmentBuilder.create()
                  .withMinimum(new BigDecimal(-1)) //
                  .withMaximum(new BigDecimal(-1)) //
                  .withStep(new BigDecimal(-1)) //
                  .withPattern("pattern1").build();
          registerStateDescriptionFragmentProvider(stateDescriptionFragment1, -1);
  
          StateDescriptionFragment stateDescriptionFragment2 = StateDescriptionFragmentBuilder.create()
                  .withMinimum(new BigDecimal(-2)) //
                  .withMaximum(new BigDecimal(-2)) //
                  .withStep(new BigDecimal(-2)) //
                  .withPattern("pattern2").build();
          registerStateDescriptionFragmentProvider(stateDescriptionFragment2, -2);
  
          StateDescription stateDescription = item.getStateDescription();
  
          assertThat(stateDescription.getMinimum(), is(stateDescriptionFragment1.getMinimum()));
          assertThat(stateDescription.getMaximum(), is(stateDescriptionFragment1.getMaximum()));
          assertThat(stateDescription.getStep(), is(stateDescriptionFragment1.getStep()));
          assertThat(stateDescription.getPattern(), is(stateDescriptionFragment1.getPattern()));
      }
test_case.class_method_signature: StateDescriptionServiceImplTest.testMinValueMaxValueStepAndPatternTwoDescriptionProviders()
test_case.full_signature: @Test public void testMinValueMaxValueStepAndPatternTwoDescriptionProviders()
test_case.identifier: testMinValueMaxValueStepAndPatternTwoDescriptionProviders
test_case.invocations: build withPattern withStep withMaximum withMinimum create registerStateDescriptionFragmentProvider build withPattern withStep withMaximum withMinimum create registerStateDescriptionFragmentProvider getStateDescription assertThat getMinimum is getMinimum assertThat getMaximum is getMaximum assertThat getStep is getStep assertThat getPattern is getPattern
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMinValueMaxValueStepAndPatternTwoDescriptionProviders()
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)