Interface Variant


public interface Variant
Variant
Example to create an instance using the builder pattern

     Variant variant = Variant.builder()
             .id(1)
             .sku("{sku}")
             .key("{key}")
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull Integer getId()
      Returns:
      id
    • getSku

      @NotNull @NotNull String getSku()
      Returns:
      sku
    • getKey

      @NotNull @NotNull String getKey()
      Returns:
      key
    • setId

      void setId(Integer id)
      set id
      Parameters:
      id - value to be set
    • setSku

      void setSku(String sku)
      set sku
      Parameters:
      sku - value to be set
    • setKey

      void setKey(String key)
      set key
      Parameters:
      key - value to be set
    • of

      static Variant of()
      factory method
      Returns:
      instance of Variant
    • of

      static Variant of(Variant template)
      factory method to create a shallow copy Variant
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static Variant deepCopy(@Nullable Variant template)
      factory method to create a deep copy of Variant
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static VariantBuilder builder()
      builder factory method for Variant
      Returns:
      builder
    • builder

      static VariantBuilder builder(Variant template)
      create builder for Variant instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withVariant

      default <T> T withVariant(Function<Variant,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<Variant> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference