Interface GenericCustomActionBuilder<ResourceUpdateActionT extends com.commercetools.api.models.ResourceUpdateAction<ResourceUpdateActionT>>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      ResourceUpdateActionT buildRemoveCustomTypeAction​(java.lang.Long variantId, java.lang.String objectId)
      Creates a CTP "setCustomType" update action on the given resource T that removes the custom type set on the given resource T.
      ResourceUpdateActionT buildSetCustomFieldAction​(java.lang.Long variantId, java.lang.String objectId, java.lang.String customFieldName, java.lang.Object customFieldValue)
      Creates a CTP "setCustomField" update action on the given resource T that updates a custom field with customFieldName and a customFieldValue on the given resource T.
      ResourceUpdateActionT buildSetCustomTypeAction​(java.lang.Long variantId, java.lang.String objectId, java.lang.String customTypeId, java.util.Map<java.lang.String,​java.lang.Object> customFieldsJsonMap)
      Creates a CTP "setCustomType" update action on the given resource T.
    • Method Detail

      • buildRemoveCustomTypeAction

        @Nonnull
        ResourceUpdateActionT buildRemoveCustomTypeAction​(@Nullable
                                                          java.lang.Long variantId,
                                                          @Nullable
                                                          java.lang.String objectId)
        Creates a CTP "setCustomType" update action on the given resource T that removes the custom type set on the given resource T. If the resource that has the custom fields is a secondary resource (e.g. price or asset) and not a primary resource (e.g Category, Product, Channel, etc..), the variantId and the objectId will be used to identify this secondary resource within its container.
        Parameters:
        variantId - an optional field which could be used to identify the variant that holds the a resource (e.g. asset) which has the custom fields.
        objectId - an optional field which could be used to identify the id of the resource (e.g. asset, price, etc..) which has the custom fields.
        Returns:
        a setCustomType update action that removes the custom type from the resource it's requested on.
      • buildSetCustomTypeAction

        @Nonnull
        ResourceUpdateActionT buildSetCustomTypeAction​(@Nullable
                                                       java.lang.Long variantId,
                                                       @Nullable
                                                       java.lang.String objectId,
                                                       @Nonnull
                                                       java.lang.String customTypeId,
                                                       @Nullable
                                                       java.util.Map<java.lang.String,​java.lang.Object> customFieldsJsonMap)
        Creates a CTP "setCustomType" update action on the given resource T. If the resource that has the custom fields is a secondary resource (e.g. Price or asset) and not a primary resource (e.g Category, Product, Channel, etc..), the variantId and the objectId will be used to identify this secondary resource within its container.
        Parameters:
        variantId - an optional field which could be used to identify the variant that holds the a resource (e.g. asset) which has the custom fields.
        objectId - an optional field which could be used to identify the id of the resource (e.g. asset, price, etc..) which has the custom fields.
        customTypeId - the id of the new custom type.
        customFieldsJsonMap - the custom fields map of JSON values.
        Returns:
        a setCustomType update action of the type of the resource it's requested on.
      • buildSetCustomFieldAction

        @Nonnull
        ResourceUpdateActionT buildSetCustomFieldAction​(@Nullable
                                                        java.lang.Long variantId,
                                                        @Nullable
                                                        java.lang.String objectId,
                                                        @Nullable
                                                        java.lang.String customFieldName,
                                                        @Nullable
                                                        java.lang.Object customFieldValue)
        Creates a CTP "setCustomField" update action on the given resource T that updates a custom field with customFieldName and a customFieldValue on the given resource T. If the resource that has the custom fields is a secondary resource (e.g. Price or asset) and not a primary resource (e.g Category, Product, Channel, etc..), the variantId and the objectId will be used to identify this secondary resource within its container.
        Parameters:
        variantId - an optional field which could be used to identify the variant that holds the a resource (e.g. asset) which has the custom fields.
        objectId - an optional field which could be used to identify the id of the resource (e.g. asset, price, etc..) which has the custom fields.
        customFieldName - the name of the custom field to update.
        customFieldValue - the new JSON value of the custom field.
        Returns:
        a setCustomField update action on the provided field name, with the provided value on the resource it's requested on.