Class ExtensionInputBuilder

java.lang.Object
com.commercetools.api.models.extension.ExtensionInputBuilder
All Implemented Interfaces:
Builder<ExtensionInput>

public class ExtensionInputBuilder extends Object implements Builder<ExtensionInput>
ExtensionInputBuilder
Example to create an instance using the builder pattern

     ExtensionInput extensionInput = ExtensionInput.builder()
             .action(ExtensionAction.CREATE)
             .resource(resourceBuilder -> resourceBuilder)
             .build()
 
  • Constructor Details

    • ExtensionInputBuilder

      public ExtensionInputBuilder()
  • Method Details

    • action

      public ExtensionInputBuilder action(ExtensionAction action)

      Create or Update request.

      Parameters:
      action - value to be set
      Returns:
      Builder
    • resource

      public ExtensionInputBuilder resource(Reference resource)

      Expanded reference to the resource that triggered the Extension.

      Parameters:
      resource - value to be set
      Returns:
      Builder
    • resource

      public ExtensionInputBuilder resource(Function<ReferenceBuilder,Builder<? extends Reference>> builder)

      Expanded reference to the resource that triggered the Extension.

      Parameters:
      builder - function to build the resource value
      Returns:
      Builder
    • getAction

      public ExtensionAction getAction()

      Create or Update request.

      Returns:
      action
    • getResource

      public Reference getResource()

      Expanded reference to the resource that triggered the Extension.

      Returns:
      resource
    • build

      public ExtensionInput build()
      builds ExtensionInput with checking for non-null required values
      Specified by:
      build in interface Builder<ExtensionInput>
      Returns:
      ExtensionInput
    • buildUnchecked

      public ExtensionInput buildUnchecked()
      builds ExtensionInput without checking for non-null required values
      Returns:
      ExtensionInput
    • of

      public static ExtensionInputBuilder of()
      factory method for an instance of ExtensionInputBuilder
      Returns:
      builder
    • of

      public static ExtensionInputBuilder of(ExtensionInput template)
      create builder for ExtensionInput instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder