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