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

io.swagger.petstore3.models.Tag Maven / Gradle / Ivy

/*
 * SwaggerPetstoreOpenAPI30Lib
 *
 * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
 */

package io.swagger.petstore3.models;

import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSetter;

/**
 * This is a model class for Tag type.
 */
public class Tag {
    private Long id;
    private String name;

    /**
     * Default constructor.
     */
    public Tag() {
    }

    /**
     * Initialization constructor.
     * @param  id  Long value for id.
     * @param  name  String value for name.
     */
    public Tag(
            Long id,
            String name) {
        this.id = id;
        this.name = name;
    }

    /**
     * Getter for Id.
     * @return Returns the Long
     */
    @JsonGetter("id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public Long getId() {
        return id;
    }

    /**
     * Setter for Id.
     * @param id Value for Long
     */
    @JsonSetter("id")
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * Getter for Name.
     * @return Returns the String
     */
    @JsonGetter("name")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public String getName() {
        return name;
    }

    /**
     * Setter for Name.
     * @param name Value for String
     */
    @JsonSetter("name")
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Converts this Tag into string format.
     * @return String representation of this class
     */
    @Override
    public String toString() {
        return "Tag [" + "id=" + id + ", name=" + name + "]";
    }

    /**
     * Builds a new {@link Tag.Builder} object.
     * Creates the instance with the state of the current model.
     * @return a new {@link Tag.Builder} object
     */
    public Builder toBuilder() {
        Builder builder = new Builder()
                .id(getId())
                .name(getName());
        return builder;
    }

    /**
     * Class to build instances of {@link Tag}.
     */
    public static class Builder {
        private Long id;
        private String name;



        /**
         * Setter for id.
         * @param  id  Long value for id.
         * @return Builder
         */
        public Builder id(Long id) {
            this.id = id;
            return this;
        }

        /**
         * Setter for name.
         * @param  name  String value for name.
         * @return Builder
         */
        public Builder name(String name) {
            this.name = name;
            return this;
        }

        /**
         * Builds a new {@link Tag} object using the set fields.
         * @return {@link Tag}
         */
        public Tag build() {
            return new Tag(id, name);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy