
io.gs2.ranking2.model.SubscribeRankingModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gs2-java-sdk Show documentation
Show all versions of gs2-java-sdk Show documentation
Game Server Services SDK for Java
The newest version!
/*
* Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
* Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file 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 io.gs2.ranking2.model;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import io.gs2.core.model.IModel;
@SuppressWarnings("serial")
@JsonIgnoreProperties(ignoreUnknown=true)
public class SubscribeRankingModel implements IModel, Serializable, Comparable {
private String subscribeRankingModelId;
private String name;
private String metadata;
private Long minimumValue;
private Long maximumValue;
private Boolean sum;
private String orderDirection;
private String entryPeriodEventId;
private String accessPeriodEventId;
public String getSubscribeRankingModelId() {
return subscribeRankingModelId;
}
public void setSubscribeRankingModelId(String subscribeRankingModelId) {
this.subscribeRankingModelId = subscribeRankingModelId;
}
public SubscribeRankingModel withSubscribeRankingModelId(String subscribeRankingModelId) {
this.subscribeRankingModelId = subscribeRankingModelId;
return this;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public SubscribeRankingModel withName(String name) {
this.name = name;
return this;
}
public String getMetadata() {
return metadata;
}
public void setMetadata(String metadata) {
this.metadata = metadata;
}
public SubscribeRankingModel withMetadata(String metadata) {
this.metadata = metadata;
return this;
}
public Long getMinimumValue() {
return minimumValue;
}
public void setMinimumValue(Long minimumValue) {
this.minimumValue = minimumValue;
}
public SubscribeRankingModel withMinimumValue(Long minimumValue) {
this.minimumValue = minimumValue;
return this;
}
public Long getMaximumValue() {
return maximumValue;
}
public void setMaximumValue(Long maximumValue) {
this.maximumValue = maximumValue;
}
public SubscribeRankingModel withMaximumValue(Long maximumValue) {
this.maximumValue = maximumValue;
return this;
}
public Boolean getSum() {
return sum;
}
public void setSum(Boolean sum) {
this.sum = sum;
}
public SubscribeRankingModel withSum(Boolean sum) {
this.sum = sum;
return this;
}
public String getOrderDirection() {
return orderDirection;
}
public void setOrderDirection(String orderDirection) {
this.orderDirection = orderDirection;
}
public SubscribeRankingModel withOrderDirection(String orderDirection) {
this.orderDirection = orderDirection;
return this;
}
public String getEntryPeriodEventId() {
return entryPeriodEventId;
}
public void setEntryPeriodEventId(String entryPeriodEventId) {
this.entryPeriodEventId = entryPeriodEventId;
}
public SubscribeRankingModel withEntryPeriodEventId(String entryPeriodEventId) {
this.entryPeriodEventId = entryPeriodEventId;
return this;
}
public String getAccessPeriodEventId() {
return accessPeriodEventId;
}
public void setAccessPeriodEventId(String accessPeriodEventId) {
this.accessPeriodEventId = accessPeriodEventId;
}
public SubscribeRankingModel withAccessPeriodEventId(String accessPeriodEventId) {
this.accessPeriodEventId = accessPeriodEventId;
return this;
}
public static SubscribeRankingModel fromJson(JsonNode data) {
if (data == null) {
return null;
}
return new SubscribeRankingModel()
.withSubscribeRankingModelId(data.get("subscribeRankingModelId") == null || data.get("subscribeRankingModelId").isNull() ? null : data.get("subscribeRankingModelId").asText())
.withName(data.get("name") == null || data.get("name").isNull() ? null : data.get("name").asText())
.withMetadata(data.get("metadata") == null || data.get("metadata").isNull() ? null : data.get("metadata").asText())
.withMinimumValue(data.get("minimumValue") == null || data.get("minimumValue").isNull() ? null : data.get("minimumValue").longValue())
.withMaximumValue(data.get("maximumValue") == null || data.get("maximumValue").isNull() ? null : data.get("maximumValue").longValue())
.withSum(data.get("sum") == null || data.get("sum").isNull() ? null : data.get("sum").booleanValue())
.withOrderDirection(data.get("orderDirection") == null || data.get("orderDirection").isNull() ? null : data.get("orderDirection").asText())
.withEntryPeriodEventId(data.get("entryPeriodEventId") == null || data.get("entryPeriodEventId").isNull() ? null : data.get("entryPeriodEventId").asText())
.withAccessPeriodEventId(data.get("accessPeriodEventId") == null || data.get("accessPeriodEventId").isNull() ? null : data.get("accessPeriodEventId").asText());
}
public JsonNode toJson() {
return new ObjectMapper().valueToTree(
new HashMap() {{
put("subscribeRankingModelId", getSubscribeRankingModelId());
put("name", getName());
put("metadata", getMetadata());
put("minimumValue", getMinimumValue());
put("maximumValue", getMaximumValue());
put("sum", getSum());
put("orderDirection", getOrderDirection());
put("entryPeriodEventId", getEntryPeriodEventId());
put("accessPeriodEventId", getAccessPeriodEventId());
}}
);
}
@Override
public int compareTo(SubscribeRankingModel o) {
return subscribeRankingModelId.compareTo(o.subscribeRankingModelId);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.subscribeRankingModelId == null) ? 0 : this.subscribeRankingModelId.hashCode());
result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
result = prime * result + ((this.metadata == null) ? 0 : this.metadata.hashCode());
result = prime * result + ((this.minimumValue == null) ? 0 : this.minimumValue.hashCode());
result = prime * result + ((this.maximumValue == null) ? 0 : this.maximumValue.hashCode());
result = prime * result + ((this.sum == null) ? 0 : this.sum.hashCode());
result = prime * result + ((this.orderDirection == null) ? 0 : this.orderDirection.hashCode());
result = prime * result + ((this.entryPeriodEventId == null) ? 0 : this.entryPeriodEventId.hashCode());
result = prime * result + ((this.accessPeriodEventId == null) ? 0 : this.accessPeriodEventId.hashCode());
return result;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null)
return false;
if (getClass() != o.getClass())
return false;
SubscribeRankingModel other = (SubscribeRankingModel) o;
if (subscribeRankingModelId == null) {
return other.subscribeRankingModelId == null;
} else if (!subscribeRankingModelId.equals(other.subscribeRankingModelId)) {
return false;
}
if (name == null) {
return other.name == null;
} else if (!name.equals(other.name)) {
return false;
}
if (metadata == null) {
return other.metadata == null;
} else if (!metadata.equals(other.metadata)) {
return false;
}
if (minimumValue == null) {
return other.minimumValue == null;
} else if (!minimumValue.equals(other.minimumValue)) {
return false;
}
if (maximumValue == null) {
return other.maximumValue == null;
} else if (!maximumValue.equals(other.maximumValue)) {
return false;
}
if (sum == null) {
return other.sum == null;
} else if (!sum.equals(other.sum)) {
return false;
}
if (orderDirection == null) {
return other.orderDirection == null;
} else if (!orderDirection.equals(other.orderDirection)) {
return false;
}
if (entryPeriodEventId == null) {
return other.entryPeriodEventId == null;
} else if (!entryPeriodEventId.equals(other.entryPeriodEventId)) {
return false;
}
if (accessPeriodEventId == null) {
return other.accessPeriodEventId == null;
} else if (!accessPeriodEventId.equals(other.accessPeriodEventId)) {
return false;
}
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy