All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.commercetools.history.models.change_value.AttributeValue Maven / Gradle / Ivy

There is a newer version: 17.15.1
Show newest version

package com.commercetools.history.models.change_value;

import java.time.*;
import java.util.*;
import java.util.function.Function;

import javax.annotation.Nullable;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;

import io.vrap.rmf.base.client.utils.Generated;

/**
 * AttributeValue
 *
 * 
* Example to create an instance using the builder pattern *
*

 *     AttributeValue attributeValue = AttributeValue.builder()
 *             .name("{name}")
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") @JsonDeserialize(as = AttributeValueImpl.class) public interface AttributeValue { /** *

Name of the Attribute set.

* @return name */ @NotNull @JsonProperty("name") public String getName(); /** *

Value set for the Attribute determined by the AttributeType:

*
    *
  • For Enum Type and Localized Enum Type, value is the key of the Plain Enum Value or Localized Enum Value objects, or the complete objects.
  • *
  • For Localizable Text Type, value is the LocalizedString object.
  • *
  • For Money Type Attributes, value is the Money object.
  • *
  • For Set Type Attributes, value is the entire set object.
  • *
  • For Nested Type Attributes, value is the list of values of all Attributes of the nested Product.
  • *
  • For Reference Type Attributes, value is the Reference object.
  • *
* @return value */ @NotNull @JsonProperty("value") public Object getValue(); /** *

Name of the Attribute set.

* @param name value to be set */ public void setName(final String name); /** *

Value set for the Attribute determined by the AttributeType:

*
    *
  • For Enum Type and Localized Enum Type, value is the key of the Plain Enum Value or Localized Enum Value objects, or the complete objects.
  • *
  • For Localizable Text Type, value is the LocalizedString object.
  • *
  • For Money Type Attributes, value is the Money object.
  • *
  • For Set Type Attributes, value is the entire set object.
  • *
  • For Nested Type Attributes, value is the list of values of all Attributes of the nested Product.
  • *
  • For Reference Type Attributes, value is the Reference object.
  • *
* @param value value to be set */ public void setValue(final Object value); /** * factory method * @return instance of AttributeValue */ public static AttributeValue of() { return new AttributeValueImpl(); } /** * factory method to create a shallow copy AttributeValue * @param template instance to be copied * @return copy instance */ public static AttributeValue of(final AttributeValue template) { AttributeValueImpl instance = new AttributeValueImpl(); instance.setName(template.getName()); instance.setValue(template.getValue()); return instance; } /** * factory method to create a deep copy of AttributeValue * @param template instance to be copied * @return copy instance */ @Nullable public static AttributeValue deepCopy(@Nullable final AttributeValue template) { if (template == null) { return null; } AttributeValueImpl instance = new AttributeValueImpl(); instance.setName(template.getName()); instance.setValue(template.getValue()); return instance; } /** * builder factory method for AttributeValue * @return builder */ public static AttributeValueBuilder builder() { return AttributeValueBuilder.of(); } /** * create builder for AttributeValue instance * @param template instance with prefilled values for the builder * @return builder */ public static AttributeValueBuilder builder(final AttributeValue template) { return AttributeValueBuilder.of(template); } /** * accessor map function * @param mapped type * @param helper function to map the object * @return mapped value */ default T withAttributeValue(Function helper) { return helper.apply(this); } /** * gives a TypeReference for usage with Jackson DataBind * @return TypeReference */ public static com.fasterxml.jackson.core.type.TypeReference typeReference() { return new com.fasterxml.jackson.core.type.TypeReference() { @Override public String toString() { return "TypeReference"; } }; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy