001package com.box.sdkgen.schemas.retentionpolicy;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.fasterxml.jackson.annotation.JsonFilter;
006import com.fasterxml.jackson.annotation.JsonProperty;
007import java.util.Objects;
008
009@JsonFilter("nullablePropertyFilter")
010public class RetentionPolicyAssignmentCountsField extends SerializableObject {
011
012  /** The number of enterprise assignments this policy has. The maximum value is 1. */
013  protected Long enterprise;
014
015  /** The number of folder assignments this policy has. */
016  protected Long folder;
017
018  /** The number of metadata template assignments this policy has. */
019  @JsonProperty("metadata_template")
020  protected Long metadataTemplate;
021
022  public RetentionPolicyAssignmentCountsField() {
023    super();
024  }
025
026  protected RetentionPolicyAssignmentCountsField(Builder builder) {
027    super();
028    this.enterprise = builder.enterprise;
029    this.folder = builder.folder;
030    this.metadataTemplate = builder.metadataTemplate;
031    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
032  }
033
034  public Long getEnterprise() {
035    return enterprise;
036  }
037
038  public Long getFolder() {
039    return folder;
040  }
041
042  public Long getMetadataTemplate() {
043    return metadataTemplate;
044  }
045
046  @Override
047  public boolean equals(Object o) {
048    if (this == o) {
049      return true;
050    }
051    if (o == null || getClass() != o.getClass()) {
052      return false;
053    }
054    RetentionPolicyAssignmentCountsField casted = (RetentionPolicyAssignmentCountsField) o;
055    return Objects.equals(enterprise, casted.enterprise)
056        && Objects.equals(folder, casted.folder)
057        && Objects.equals(metadataTemplate, casted.metadataTemplate);
058  }
059
060  @Override
061  public int hashCode() {
062    return Objects.hash(enterprise, folder, metadataTemplate);
063  }
064
065  @Override
066  public String toString() {
067    return "RetentionPolicyAssignmentCountsField{"
068        + "enterprise='"
069        + enterprise
070        + '\''
071        + ", "
072        + "folder='"
073        + folder
074        + '\''
075        + ", "
076        + "metadataTemplate='"
077        + metadataTemplate
078        + '\''
079        + "}";
080  }
081
082  public static class Builder extends NullableFieldTracker {
083
084    protected Long enterprise;
085
086    protected Long folder;
087
088    protected Long metadataTemplate;
089
090    public Builder enterprise(Long enterprise) {
091      this.enterprise = enterprise;
092      return this;
093    }
094
095    public Builder folder(Long folder) {
096      this.folder = folder;
097      return this;
098    }
099
100    public Builder metadataTemplate(Long metadataTemplate) {
101      this.metadataTemplate = metadataTemplate;
102      return this;
103    }
104
105    public RetentionPolicyAssignmentCountsField build() {
106      return new RetentionPolicyAssignmentCountsField(this);
107    }
108  }
109}