001 002package com.commercetools.api.models.graph_ql; 003 004import java.util.*; 005 006import io.vrap.rmf.base.client.Builder; 007import io.vrap.rmf.base.client.utils.Generated; 008 009/** 010 * GraphQLErrorLocationBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * GraphQLErrorLocation graphQLErrorLocation = GraphQLErrorLocation.builder() 016 * .line(1) 017 * .column(1) 018 * .build() 019 * </code></pre> 020 * </div> 021 */ 022@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 023public class GraphQLErrorLocationBuilder implements Builder<GraphQLErrorLocation> { 024 025 private Integer line; 026 027 private Integer column; 028 029 /** 030 * set the value to the line 031 * @param line value to be set 032 * @return Builder 033 */ 034 035 public GraphQLErrorLocationBuilder line(final Integer line) { 036 this.line = line; 037 return this; 038 } 039 040 /** 041 * set the value to the column 042 * @param column value to be set 043 * @return Builder 044 */ 045 046 public GraphQLErrorLocationBuilder column(final Integer column) { 047 this.column = column; 048 return this; 049 } 050 051 /** 052 * value of line} 053 * @return line 054 */ 055 056 public Integer getLine() { 057 return this.line; 058 } 059 060 /** 061 * value of column} 062 * @return column 063 */ 064 065 public Integer getColumn() { 066 return this.column; 067 } 068 069 /** 070 * builds GraphQLErrorLocation with checking for non-null required values 071 * @return GraphQLErrorLocation 072 */ 073 public GraphQLErrorLocation build() { 074 Objects.requireNonNull(line, GraphQLErrorLocation.class + ": line is missing"); 075 Objects.requireNonNull(column, GraphQLErrorLocation.class + ": column is missing"); 076 return new GraphQLErrorLocationImpl(line, column); 077 } 078 079 /** 080 * builds GraphQLErrorLocation without checking for non-null required values 081 * @return GraphQLErrorLocation 082 */ 083 public GraphQLErrorLocation buildUnchecked() { 084 return new GraphQLErrorLocationImpl(line, column); 085 } 086 087 /** 088 * factory method for an instance of GraphQLErrorLocationBuilder 089 * @return builder 090 */ 091 public static GraphQLErrorLocationBuilder of() { 092 return new GraphQLErrorLocationBuilder(); 093 } 094 095 /** 096 * create builder for GraphQLErrorLocation instance 097 * @param template instance with prefilled values for the builder 098 * @return builder 099 */ 100 public static GraphQLErrorLocationBuilder of(final GraphQLErrorLocation template) { 101 GraphQLErrorLocationBuilder builder = new GraphQLErrorLocationBuilder(); 102 builder.line = template.getLine(); 103 builder.column = template.getColumn(); 104 return builder; 105 } 106 107}