io.proximax.xpx.model.GenericResponseMessage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xpx-java-sdk Show documentation
Show all versions of xpx-java-sdk Show documentation
Proximax P2P File Storage Java SDK (NIS1 Compatible)
/*
* Copyright 2018 ProximaX Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
/*
* Proximax P2P Storage REST API
* Proximax P2P Storage REST API
*
* OpenAPI spec version: v0.0.1
* Contact: [email protected]
*
* 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.
*/
package io.proximax.xpx.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.Objects;
/**
* GenericResponseMessage.
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-25T23:45:59.064-04:00")
public class GenericResponseMessage {
/** The message. */
@SerializedName("message")
private String message = null;
/**
* Gets or Sets status.
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
/** The 100. */
_100("100"),
/** The 101. */
_101("101"),
/** The 102. */
_102("102"),
/** The 103. */
_103("103"),
/** The 200. */
_200("200"),
/** The 201. */
_201("201"),
/** The 202. */
_202("202"),
/** The 203. */
_203("203"),
/** The 204. */
_204("204"),
/** The 205. */
_205("205"),
/** The 206. */
_206("206"),
/** The 207. */
_207("207"),
/** The 208. */
_208("208"),
/** The 226. */
_226("226"),
/** The 300. */
_300("300"),
/** The 301. */
_301("301"),
/** The 302. */
_302("302"),
/** The 303. */
_303("303"),
/** The 304. */
_304("304"),
/** The 305. */
_305("305"),
/** The 307. */
_307("307"),
/** The 308. */
_308("308"),
/** The 400. */
_400("400"),
/** The 401. */
_401("401"),
/** The 402. */
_402("402"),
/** The 403. */
_403("403"),
/** The 404. */
_404("404"),
/** The 405. */
_405("405"),
/** The 406. */
_406("406"),
/** The 407. */
_407("407"),
/** The 408. */
_408("408"),
/** The 409. */
_409("409"),
/** The 410. */
_410("410"),
/** The 411. */
_411("411"),
/** The 412. */
_412("412"),
/** The 413. */
_413("413"),
/** The 414. */
_414("414"),
/** The 415. */
_415("415"),
/** The 416. */
_416("416"),
/** The 417. */
_417("417"),
/** The 418. */
_418("418"),
/** The 419. */
_419("419"),
/** The 420. */
_420("420"),
/** The 421. */
_421("421"),
/** The 422. */
_422("422"),
/** The 423. */
_423("423"),
/** The 424. */
_424("424"),
/** The 426. */
_426("426"),
/** The 428. */
_428("428"),
/** The 429. */
_429("429"),
/** The 431. */
_431("431"),
/** The 451. */
_451("451"),
/** The 500. */
_500("500"),
/** The 501. */
_501("501"),
/** The 502. */
_502("502"),
/** The 503. */
_503("503"),
/** The 504. */
_504("504"),
/** The 505. */
_505("505"),
/** The 506. */
_506("506"),
/** The 507. */
_507("507"),
/** The 508. */
_508("508"),
/** The 509. */
_509("509"),
/** The 510. */
_510("510"),
/** The 511. */
_511("511");
/** The value. */
private String value;
/**
* Instantiates a new status enum.
*
* @param value the value
*/
StatusEnum(String value) {
this.value = value;
}
/**
* Gets the value.
*
* @return the value
*/
public String getValue() {
return value;
}
/* (non-Javadoc)
* @see java.lang.Enum#toString()
*/
@Override
public String toString() {
return String.valueOf(value);
}
/**
* From value.
*
* @param text the text
* @return the status enum
*/
public static StatusEnum fromValue(String text) {
for (StatusEnum b : StatusEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
/**
* The Class Adapter.
*/
public static class Adapter extends TypeAdapter {
/* (non-Javadoc)
* @see com.google.gson.TypeAdapter#write(com.google.gson.stream.JsonWriter, java.lang.Object)
*/
@Override
public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
/* (non-Javadoc)
* @see com.google.gson.TypeAdapter#read(com.google.gson.stream.JsonReader)
*/
@Override
public StatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StatusEnum.fromValue(String.valueOf(value));
}
}
}
/** The status. */
@SerializedName("status")
private StatusEnum status = null;
/**
* Message.
*
* @param message the message
* @return the generic response message
*/
public GenericResponseMessage message(String message) {
this.message = message;
return this;
}
/**
* Get message.
*
* @return message
*/
@ApiModelProperty(value = "")
public String getMessage() {
return message;
}
/**
* Sets the message.
*
* @param message the new message
*/
public void setMessage(String message) {
this.message = message;
}
/**
* Status.
*
* @param status the status
* @return the generic response message
*/
public GenericResponseMessage status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get status.
*
* @return status
*/
@ApiModelProperty(value = "")
public StatusEnum getStatus() {
return status;
}
/**
* Sets the status.
*
* @param status the new status
*/
public void setStatus(StatusEnum status) {
this.status = status;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GenericResponseMessage genericResponseMessage = (GenericResponseMessage) o;
return Objects.equals(this.message, genericResponseMessage.message) &&
Objects.equals(this.status, genericResponseMessage.status);
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
return Objects.hash(message, status);
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class GenericResponseMessage {\n");
sb.append(" message: ").append(toIndentedString(message)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*
* @param o the o
* @return the string
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}