@Generated(value="io.sphere.sdk.annotations.processors.generators.UpdateActionsGenerator", comments="Generated from: io.sphere.sdk.shippingmethods.ShippingMethod") public final class SetKey extends UpdateActionImpl<ShippingMethod>
key
property of a ShippingMethod
.
withUpdateableShippingMethod(client(), shippingMethod -> { final String newKey = randomKey(); assertThat(shippingMethod.getKey()).isNotEqualTo(newKey); final ShippingMethodUpdateCommand cmd = ShippingMethodUpdateCommand.of(shippingMethod, SetKey.of(newKey)); final ShippingMethod updatedShippingMethod = client().executeBlocking(cmd); assertThat(updatedShippingMethod.getKey()).isEqualTo(newKey); return updatedShippingMethod; });
See the test code.
ShippingMethod.getKey()
Modifier and Type | Method and Description |
---|---|
String |
getKey() |
static SetKey |
of(String key)
Creates a new update action from the given parameters.
|
static SetKey |
ofUnset()
Creates a new update action to unset the
key property. |
getAction
public static SetKey of(@Nullable String key)
key
- the key
property ShippingMethod.getKey()
.SetKey
update action.public static SetKey ofUnset()
key
property.SetKey
update action.