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

com.commercetools.history.models.common.GeoLocationBuilder Maven / Gradle / Ivy

There is a newer version: 17.15.1
Show newest version

package com.commercetools.history.models.common;

import java.util.*;

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

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

 *     GeoLocation geoLocation = GeoLocation.builder()
 *             .type("{type}")
 *             .plusCoordinates(coordinatesBuilder -> coordinatesBuilder)
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class GeoLocationBuilder implements Builder { private String type; private java.util.List coordinates; /** * set the value to the type * @param type value to be set * @return Builder */ public GeoLocationBuilder type(final String type) { this.type = type; return this; } /** * set values to the coordinates * @param coordinates value to be set * @return Builder */ public GeoLocationBuilder coordinates(final Integer... coordinates) { this.coordinates = new ArrayList<>(Arrays.asList(coordinates)); return this; } /** * set value to the coordinates * @param coordinates value to be set * @return Builder */ public GeoLocationBuilder coordinates(final java.util.List coordinates) { this.coordinates = coordinates; return this; } /** * add values to the coordinates * @param coordinates value to be set * @return Builder */ public GeoLocationBuilder plusCoordinates(final Integer... coordinates) { if (this.coordinates == null) { this.coordinates = new ArrayList<>(); } this.coordinates.addAll(Arrays.asList(coordinates)); return this; } /** * value of type} * @return type */ public String getType() { return this.type; } /** * value of coordinates} * @return coordinates */ public java.util.List getCoordinates() { return this.coordinates; } /** * builds GeoLocation with checking for non-null required values * @return GeoLocation */ public GeoLocation build() { Objects.requireNonNull(type, GeoLocation.class + ": type is missing"); Objects.requireNonNull(coordinates, GeoLocation.class + ": coordinates is missing"); return new GeoLocationImpl(type, coordinates); } /** * builds GeoLocation without checking for non-null required values * @return GeoLocation */ public GeoLocation buildUnchecked() { return new GeoLocationImpl(type, coordinates); } /** * factory method for an instance of GeoLocationBuilder * @return builder */ public static GeoLocationBuilder of() { return new GeoLocationBuilder(); } /** * create builder for GeoLocation instance * @param template instance with prefilled values for the builder * @return builder */ public static GeoLocationBuilder of(final GeoLocation template) { GeoLocationBuilder builder = new GeoLocationBuilder(); builder.type = template.getType(); builder.coordinates = template.getCoordinates(); return builder; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy