Tabnine Logo
EnumValue.getLabel
Code IndexAdd Tabnine to your IDE (free)

How to use
getLabel
method
in
io.sphere.sdk.models.EnumValue

Best Java code snippets using io.sphere.sdk.models.EnumValue.getLabel (Showing top 12 results out of 315)

origin: com.commercetools.sdk.jvm.core/commercetools-models

@Override
protected String convertEnumValue(final EnumValue enumValue, final Attribute attribute, final ProductType productType) {
  return enumValue.getLabel();
}
origin: io.sphere.sdk.jvm/sphere-models

@Override
protected String convertEnumValue(final EnumValue enumValue, final Attribute attribute, final ProductType productType) {
  return enumValue.getLabel();
}
origin: commercetools/commercetools-jvm-sdk

@Override
protected String convertEnumValue(final EnumValue enumValue, final Attribute attribute, final ProductType productType) {
  return enumValue.getLabel();
}
origin: com.commercetools.sunrise/common

public static String attributeValue(final Attribute attribute, final List<Locale> locales, final MetaProductType metaProductType) {
  final AttributeExtraction<String> attributeExtraction = AttributeExtraction.of(metaProductType, attribute);
  return attributeExtraction
      .ifIs(AttributeAccess.ofLocalizedString(), v -> v.find(locales).orElse(""))
      .ifIs(AttributeAccess.ofLocalizedEnumValue(), v -> v.getLabel().find(locales).orElse(""))
      .ifIs(AttributeAccess.ofEnumValue(), v -> v.getLabel())
      .ifIs(AttributeAccess.ofString(), v -> v)
      .findValue()
      .orElse("");
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void facetedSearchOnEnumLabelSetAttributes() throws Exception {
  testResultWithTerms(PRODUCT_MODEL.allVariants().attribute().ofEnumSet(ATTR_NAME_ENUM_SET).label().is(ENUM_THREE.getLabel()),
      ids -> assertThat(ids).containsOnly(product1.getId()),
      termStats -> assertThat(termStats).containsExactly(
          TermStats.of(ENUM_TWO.getLabel(), 2L),
          TermStats.of(ENUM_THREE.getLabel(), 1L)));
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void readAttributeGetValueAs() throws Exception {
  final ProductVariant masterVariant = createProduct().getMasterData().getStaged().getMasterVariant();
  final String attributeValue = masterVariant.findAttribute(SIZE_ATTR_NAME)
      .map((Attribute a) -> {
        final EnumValue enumValue = a.getValueAsEnumValue();
        return enumValue.getLabel();
      })
      .orElse("not found");
  assertThat(attributeValue).isEqualTo("S");
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void onEnumLabelSetAttributes() throws Exception {
  testTermStats(FACET.allVariants().attribute().ofEnumSet(ATTR_NAME_ENUM_SET).label().allTerms(),
      termStats -> assertThat(termStats).containsExactly(
          TermStats.of(ENUM_TWO.getLabel(), 2L),
          TermStats.of(ENUM_THREE.getLabel(), 1L)));
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void facetedSearchOnEnumLabelAttributes() throws Exception {
  testResultWithTerms(PRODUCT_MODEL.allVariants().attribute().ofEnum(ATTR_NAME_ENUM).label().is(ENUM_TWO.getLabel()),
      ids -> assertThat(ids).containsOnly(product1.getId()),
      termStats -> assertThat(termStats).containsOnly(
          TermStats.of(ENUM_TWO.getLabel(), 1L),
          TermStats.of(ENUM_THREE.getLabel(), 1L)));
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void onEnumLabelAttributes() throws Exception {
  testTermStats(FACET.allVariants().attribute().ofEnum(ATTR_NAME_ENUM).label().allTerms(),
      termStats -> assertThat(termStats).containsOnly(
          TermStats.of(ENUM_TWO.getLabel(), 1L),
          TermStats.of(ENUM_THREE.getLabel(), 1L)));
}
origin: commercetools/commercetools-jvm-sdk

final Optional<String> extractedResult = AttributeExtraction.<String>of(productType, attribute)
    .ifIs(AttributeAccess.ofLocalizedEnumValue(), v -> v.getLabel().find(ENGLISH).orElse(""))
    .ifIs(AttributeAccess.ofEnumValue(), v -> v.getLabel())
    .ifIs(AttributeAccess.ofLocalizedEnumValueSet(), v ->
        v.stream()
origin: commercetools/commercetools-jvm-sdk

@Test
public void onEnumLabelSetAttributes() throws Exception {
  testProductIds(PRODUCT_MODEL.allVariants().attribute().ofEnumSet(ATTR_NAME_ENUM_SET).label().is(ENUM_THREE.getLabel()),
      ids -> assertThat(ids).containsOnly(product1.getId()));
}
origin: commercetools/commercetools-jvm-sdk

@Test
public void onEnumLabelAttributes() throws Exception {
  testProductIds(PRODUCT_MODEL.allVariants().attribute().ofEnum(ATTR_NAME_ENUM).label().is(ENUM_TWO.getLabel()),
      ids -> assertThat(ids).containsOnly(product1.getId()));
}
io.sphere.sdk.modelsEnumValuegetLabel

Popular methods of EnumValue

  • getKey
  • of
  • typeReference

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now