Class AttributeUtils


  • public final class AttributeUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      AttributeUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<com.fasterxml.jackson.databind.JsonNode> getAttributeReferences​(com.fasterxml.jackson.databind.JsonNode attributeValueAsJson)
      Given a JsonNode this method extracts the nodes containing a "typeId" field which is representing a reference type.
      static com.fasterxml.jackson.databind.JsonNode replaceAttributeValueWithJsonAndReturnValue​(com.commercetools.api.models.product.Attribute attribute)
      Given an attribute this method converts it's value into JsonNode and set's the converted value in the attribute.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AttributeUtils

        public AttributeUtils()
    • Method Detail

      • replaceAttributeValueWithJsonAndReturnValue

        @Nonnull
        public static com.fasterxml.jackson.databind.JsonNode replaceAttributeValueWithJsonAndReturnValue​(@Nonnull
                                                                                                          com.commercetools.api.models.product.Attribute attribute)
        Given an attribute this method converts it's value into JsonNode and set's the converted value in the attribute.
        Parameters:
        attribute - - Attribute to replace it's value with a JSON representation
        Returns:
        - a JsonNode representing the attribute's value. extracted from the given attribute or empty list if the attribute * doesn't contain reference types.
      • getAttributeReferences

        public static java.util.List<com.fasterxml.jackson.databind.JsonNode> getAttributeReferences​(@Nonnull
                                                                                                     com.fasterxml.jackson.databind.JsonNode attributeValueAsJson)
        Given a JsonNode this method extracts the nodes containing a "typeId" field which is representing a reference type.
        Parameters:
        attributeValueAsJson - - JsonNode to find the "reference" nodes
        Returns:
        a List of JsonNode extracted from the given JSON or empty list if the value doesn't contain reference types.