001package com.box.sdkgen.managers.shieldinformationbarriersegmentrestrictions;
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 CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField
013    extends SerializableObject {
014
015  /** The ID reference of the restricted shield information barrier segment. */
016  protected String id;
017
018  /** The type of the restricted shield information barrier segment. */
019  @JsonDeserialize(
020      using =
021          CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField
022              .CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeFieldDeserializer
023              .class)
024  @JsonSerialize(
025      using =
026          CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField
027              .CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeFieldSerializer
028              .class)
029  protected EnumWrapper<
030          CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField>
031      type;
032
033  public CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField() {
034    super();
035  }
036
037  protected CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField(
038      Builder builder) {
039    super();
040    this.id = builder.id;
041    this.type = builder.type;
042    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
043  }
044
045  public String getId() {
046    return id;
047  }
048
049  public EnumWrapper<
050          CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField>
051      getType() {
052    return type;
053  }
054
055  @Override
056  public boolean equals(Object o) {
057    if (this == o) {
058      return true;
059    }
060    if (o == null || getClass() != o.getClass()) {
061      return false;
062    }
063    CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField casted =
064        (CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField) o;
065    return Objects.equals(id, casted.id) && Objects.equals(type, casted.type);
066  }
067
068  @Override
069  public int hashCode() {
070    return Objects.hash(id, type);
071  }
072
073  @Override
074  public String toString() {
075    return "CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField{"
076        + "id='"
077        + id
078        + '\''
079        + ", "
080        + "type='"
081        + type
082        + '\''
083        + "}";
084  }
085
086  public static class Builder extends NullableFieldTracker {
087
088    protected String id;
089
090    protected EnumWrapper<
091            CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField>
092        type;
093
094    public Builder id(String id) {
095      this.id = id;
096      return this;
097    }
098
099    public Builder type(
100        CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField
101            type) {
102      this.type =
103          new EnumWrapper<
104              CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField>(
105              type);
106      return this;
107    }
108
109    public Builder type(
110        EnumWrapper<
111                CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentTypeField>
112            type) {
113      this.type = type;
114      return this;
115    }
116
117    public CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField
118        build() {
119      return new CreateShieldInformationBarrierSegmentRestrictionRequestBodyRestrictedSegmentField(
120          this);
121    }
122  }
123}