info.glennengstrand.api.Friend.java Source code

Java tutorial

Introduction

Here is the source code for info.glennengstrand.api.Friend.java

Source

/**
 * News Feed
 * news feed api
 *
 * OpenAPI spec version: 1.0.0
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 *
 * Licensed under the Eclipse Public License - v 1.0
 *
 * https://www.eclipse.org/legal/epl-v10.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package info.glennengstrand.api;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * Friend
 */

public class Friend {
    private Long id = null;

    private Long from = null;

    private Long to = null;

    private Friend() {
    }

    public Friend(@JsonProperty("id") Long id, @JsonProperty("from") Long from, @JsonProperty("to") Long to) {
        this.id = id;
        this.from = from;
        this.to = to;
    }

    /**
    * Get id
    * @return id
    **/
    @JsonProperty("id")
    @ApiModelProperty(example = "null", value = "")
    public Long getId() {
        return id;
    }

    /**
    * Get from
    * @return from
    **/
    @JsonProperty("from")
    @ApiModelProperty(example = "null", value = "")
    public Long getFrom() {
        return from;
    }

    /**
    * Get to
    * @return to
    **/
    @JsonProperty("to")
    @ApiModelProperty(example = "null", value = "")
    public Long getTo() {
        return to;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Friend friend = (Friend) o;
        return Objects.equals(this.id, friend.id) && Objects.equals(this.from, friend.from)
                && Objects.equals(this.to, friend.to);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, from, to);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class Friend {\n");

        sb.append("    id: ").append(toIndentedString(id)).append("\n");
        sb.append("    from: ").append(toIndentedString(from)).append("\n");
        sb.append("    to: ").append(toIndentedString(to)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

    public static class FriendBuilder {
        private Long id = null;
        private Long from = null;
        private Long to = null;

        public FriendBuilder withId(Long id) {
            this.id = id;
            return this;
        }

        public FriendBuilder withFrom(Long from) {
            this.from = from;
            return this;
        }

        public FriendBuilder withTo(Long to) {
            this.to = to;
            return this;
        }

        public Friend build() {
            return new Friend(id, from, to);
        }
    }
}