001package com.box.sdkgen.schemas.userfull;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.serialization.json.EnumWrapper;
006import com.fasterxml.jackson.annotation.JsonFilter;
007import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
008import com.fasterxml.jackson.databind.annotation.JsonSerialize;
009import java.util.Objects;
010
011@JsonFilter("nullablePropertyFilter")
012public class UserFullEnterpriseField extends SerializableObject {
013
014  /** The unique identifier for this enterprise. */
015  protected String id;
016
017  /** The value will always be `enterprise`. */
018  @JsonDeserialize(
019      using = UserFullEnterpriseTypeField.UserFullEnterpriseTypeFieldDeserializer.class)
020  @JsonSerialize(using = UserFullEnterpriseTypeField.UserFullEnterpriseTypeFieldSerializer.class)
021  protected EnumWrapper<UserFullEnterpriseTypeField> type;
022
023  /** The name of the enterprise. */
024  protected String name;
025
026  public UserFullEnterpriseField() {
027    super();
028  }
029
030  protected UserFullEnterpriseField(Builder builder) {
031    super();
032    this.id = builder.id;
033    this.type = builder.type;
034    this.name = builder.name;
035    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
036  }
037
038  public String getId() {
039    return id;
040  }
041
042  public EnumWrapper<UserFullEnterpriseTypeField> getType() {
043    return type;
044  }
045
046  public String getName() {
047    return name;
048  }
049
050  @Override
051  public boolean equals(Object o) {
052    if (this == o) {
053      return true;
054    }
055    if (o == null || getClass() != o.getClass()) {
056      return false;
057    }
058    UserFullEnterpriseField casted = (UserFullEnterpriseField) o;
059    return Objects.equals(id, casted.id)
060        && Objects.equals(type, casted.type)
061        && Objects.equals(name, casted.name);
062  }
063
064  @Override
065  public int hashCode() {
066    return Objects.hash(id, type, name);
067  }
068
069  @Override
070  public String toString() {
071    return "UserFullEnterpriseField{"
072        + "id='"
073        + id
074        + '\''
075        + ", "
076        + "type='"
077        + type
078        + '\''
079        + ", "
080        + "name='"
081        + name
082        + '\''
083        + "}";
084  }
085
086  public static class Builder extends NullableFieldTracker {
087
088    protected String id;
089
090    protected EnumWrapper<UserFullEnterpriseTypeField> type;
091
092    protected String name;
093
094    public Builder id(String id) {
095      this.id = id;
096      return this;
097    }
098
099    public Builder type(UserFullEnterpriseTypeField type) {
100      this.type = new EnumWrapper<UserFullEnterpriseTypeField>(type);
101      return this;
102    }
103
104    public Builder type(EnumWrapper<UserFullEnterpriseTypeField> type) {
105      this.type = type;
106      return this;
107    }
108
109    public Builder name(String name) {
110      this.name = name;
111      return this;
112    }
113
114    public UserFullEnterpriseField build() {
115      return new UserFullEnterpriseField(this);
116    }
117  }
118}