001package com.box.sdkgen.schemas.shieldinformationbarriersegmentmemberbase;
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/** A base representation of a shield information barrier segment member object. */
012@JsonFilter("nullablePropertyFilter")
013public class ShieldInformationBarrierSegmentMemberBase extends SerializableObject {
014
015  /** The unique identifier for the shield information barrier segment member. */
016  protected String id;
017
018  /** The type of the shield information barrier segment member. */
019  @JsonDeserialize(
020      using =
021          ShieldInformationBarrierSegmentMemberBaseTypeField
022              .ShieldInformationBarrierSegmentMemberBaseTypeFieldDeserializer.class)
023  @JsonSerialize(
024      using =
025          ShieldInformationBarrierSegmentMemberBaseTypeField
026              .ShieldInformationBarrierSegmentMemberBaseTypeFieldSerializer.class)
027  protected EnumWrapper<ShieldInformationBarrierSegmentMemberBaseTypeField> type;
028
029  public ShieldInformationBarrierSegmentMemberBase() {
030    super();
031  }
032
033  protected ShieldInformationBarrierSegmentMemberBase(Builder builder) {
034    super();
035    this.id = builder.id;
036    this.type = builder.type;
037    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
038  }
039
040  public String getId() {
041    return id;
042  }
043
044  public EnumWrapper<ShieldInformationBarrierSegmentMemberBaseTypeField> getType() {
045    return type;
046  }
047
048  @Override
049  public boolean equals(Object o) {
050    if (this == o) {
051      return true;
052    }
053    if (o == null || getClass() != o.getClass()) {
054      return false;
055    }
056    ShieldInformationBarrierSegmentMemberBase casted =
057        (ShieldInformationBarrierSegmentMemberBase) o;
058    return Objects.equals(id, casted.id) && Objects.equals(type, casted.type);
059  }
060
061  @Override
062  public int hashCode() {
063    return Objects.hash(id, type);
064  }
065
066  @Override
067  public String toString() {
068    return "ShieldInformationBarrierSegmentMemberBase{"
069        + "id='"
070        + id
071        + '\''
072        + ", "
073        + "type='"
074        + type
075        + '\''
076        + "}";
077  }
078
079  public static class Builder extends NullableFieldTracker {
080
081    protected String id;
082
083    protected EnumWrapper<ShieldInformationBarrierSegmentMemberBaseTypeField> type;
084
085    public Builder id(String id) {
086      this.id = id;
087      return this;
088    }
089
090    public Builder type(ShieldInformationBarrierSegmentMemberBaseTypeField type) {
091      this.type = new EnumWrapper<ShieldInformationBarrierSegmentMemberBaseTypeField>(type);
092      return this;
093    }
094
095    public Builder type(EnumWrapper<ShieldInformationBarrierSegmentMemberBaseTypeField> type) {
096      this.type = type;
097      return this;
098    }
099
100    public ShieldInformationBarrierSegmentMemberBase build() {
101      return new ShieldInformationBarrierSegmentMemberBase(this);
102    }
103  }
104}