001 002package com.commercetools.api.models.state; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.constraints.NotNull; 010 011import com.fasterxml.jackson.annotation.*; 012import com.fasterxml.jackson.databind.annotation.*; 013 014import io.vrap.rmf.base.client.utils.Generated; 015 016/** 017 * StateRemoveRolesAction 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * StateRemoveRolesAction stateRemoveRolesAction = StateRemoveRolesAction.builder() 024 * .plusRoles(rolesBuilder -> rolesBuilder) 025 * .build() 026 * </code></pre> 027 * </div> 028 */ 029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 030@JsonDeserialize(as = StateRemoveRolesActionImpl.class) 031public interface StateRemoveRolesAction extends StateUpdateAction { 032 033 /** 034 * discriminator value for StateRemoveRolesAction 035 */ 036 String REMOVE_ROLES = "removeRoles"; 037 038 /** 039 * <p>Roles to remove from the State.</p> 040 * @return roles 041 */ 042 @NotNull 043 @JsonProperty("roles") 044 public List<StateRoleEnum> getRoles(); 045 046 /** 047 * <p>Roles to remove from the State.</p> 048 * @param roles values to be set 049 */ 050 051 @JsonIgnore 052 public void setRoles(final StateRoleEnum... roles); 053 054 /** 055 * <p>Roles to remove from the State.</p> 056 * @param roles values to be set 057 */ 058 059 public void setRoles(final List<StateRoleEnum> roles); 060 061 /** 062 * factory method 063 * @return instance of StateRemoveRolesAction 064 */ 065 public static StateRemoveRolesAction of() { 066 return new StateRemoveRolesActionImpl(); 067 } 068 069 /** 070 * factory method to create a shallow copy StateRemoveRolesAction 071 * @param template instance to be copied 072 * @return copy instance 073 */ 074 public static StateRemoveRolesAction of(final StateRemoveRolesAction template) { 075 StateRemoveRolesActionImpl instance = new StateRemoveRolesActionImpl(); 076 instance.setRoles(template.getRoles()); 077 return instance; 078 } 079 080 /** 081 * factory method to create a deep copy of StateRemoveRolesAction 082 * @param template instance to be copied 083 * @return copy instance 084 */ 085 @Nullable 086 public static StateRemoveRolesAction deepCopy(@Nullable final StateRemoveRolesAction template) { 087 if (template == null) { 088 return null; 089 } 090 StateRemoveRolesActionImpl instance = new StateRemoveRolesActionImpl(); 091 instance.setRoles(Optional.ofNullable(template.getRoles()).map(ArrayList::new).orElse(null)); 092 return instance; 093 } 094 095 /** 096 * builder factory method for StateRemoveRolesAction 097 * @return builder 098 */ 099 public static StateRemoveRolesActionBuilder builder() { 100 return StateRemoveRolesActionBuilder.of(); 101 } 102 103 /** 104 * create builder for StateRemoveRolesAction instance 105 * @param template instance with prefilled values for the builder 106 * @return builder 107 */ 108 public static StateRemoveRolesActionBuilder builder(final StateRemoveRolesAction template) { 109 return StateRemoveRolesActionBuilder.of(template); 110 } 111 112 /** 113 * accessor map function 114 * @param <T> mapped type 115 * @param helper function to map the object 116 * @return mapped value 117 */ 118 default <T> T withStateRemoveRolesAction(Function<StateRemoveRolesAction, T> helper) { 119 return helper.apply(this); 120 } 121 122 /** 123 * gives a TypeReference for usage with Jackson DataBind 124 * @return TypeReference 125 */ 126 public static com.fasterxml.jackson.core.type.TypeReference<StateRemoveRolesAction> typeReference() { 127 return new com.fasterxml.jackson.core.type.TypeReference<StateRemoveRolesAction>() { 128 @Override 129 public String toString() { 130 return "TypeReference<StateRemoveRolesAction>"; 131 } 132 }; 133 } 134}