Java tutorial
/** * 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; /** * Participant */ public class Participant { private Long id = null; private String name = null; private Participant() { } public Participant(@JsonProperty("id") Long id, @JsonProperty("name") String name) { this.id = id; this.name = name; } /** * Get id * @return id **/ @JsonProperty("id") @ApiModelProperty(example = "null", value = "") public Long getId() { return id; } /** * Get name * @return name **/ @JsonProperty("name") @ApiModelProperty(example = "null", value = "") public String getName() { return name; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Participant participant = (Participant) o; return Objects.equals(this.id, participant.id) && Objects.equals(this.name, participant.name); } @Override public int hashCode() { return Objects.hash(id, name); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Participant {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).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 ParticipantBuilder { private Long id = null; private String name = null; public ParticipantBuilder withId(Long id) { this.id = id; return this; } public ParticipantBuilder withName(String name) { this.name = name; return this; } public Participant build() { return new Participant(id, name); } } }