001package com.box.sdkgen.schemas.v2025r0.folderreferencev2025r0;
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.annotation.JsonProperty;
008import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
009import com.fasterxml.jackson.databind.annotation.JsonSerialize;
010import java.util.Objects;
011
012/** Folder reference. */
013@JsonFilter("nullablePropertyFilter")
014public class FolderReferenceV2025R0 extends SerializableObject {
015
016  /** The value will always be `folder`. */
017  @JsonDeserialize(
018      using = FolderReferenceV2025R0TypeField.FolderReferenceV2025R0TypeFieldDeserializer.class)
019  @JsonSerialize(
020      using = FolderReferenceV2025R0TypeField.FolderReferenceV2025R0TypeFieldSerializer.class)
021  protected EnumWrapper<FolderReferenceV2025R0TypeField> type;
022
023  /** ID of the folder. */
024  protected final String id;
025
026  public FolderReferenceV2025R0(@JsonProperty("id") String id) {
027    super();
028    this.id = id;
029    this.type =
030        new EnumWrapper<FolderReferenceV2025R0TypeField>(FolderReferenceV2025R0TypeField.FOLDER);
031  }
032
033  protected FolderReferenceV2025R0(Builder builder) {
034    super();
035    this.type = builder.type;
036    this.id = builder.id;
037    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
038  }
039
040  public EnumWrapper<FolderReferenceV2025R0TypeField> getType() {
041    return type;
042  }
043
044  public String getId() {
045    return id;
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    FolderReferenceV2025R0 casted = (FolderReferenceV2025R0) o;
057    return Objects.equals(type, casted.type) && Objects.equals(id, casted.id);
058  }
059
060  @Override
061  public int hashCode() {
062    return Objects.hash(type, id);
063  }
064
065  @Override
066  public String toString() {
067    return "FolderReferenceV2025R0{" + "type='" + type + '\'' + ", " + "id='" + id + '\'' + "}";
068  }
069
070  public static class Builder extends NullableFieldTracker {
071
072    protected EnumWrapper<FolderReferenceV2025R0TypeField> type;
073
074    protected final String id;
075
076    public Builder(String id) {
077      super();
078      this.id = id;
079    }
080
081    public Builder type(FolderReferenceV2025R0TypeField type) {
082      this.type = new EnumWrapper<FolderReferenceV2025R0TypeField>(type);
083      return this;
084    }
085
086    public Builder type(EnumWrapper<FolderReferenceV2025R0TypeField> type) {
087      this.type = type;
088      return this;
089    }
090
091    public FolderReferenceV2025R0 build() {
092      if (this.type == null) {
093        this.type =
094            new EnumWrapper<FolderReferenceV2025R0TypeField>(
095                FolderReferenceV2025R0TypeField.FOLDER);
096      }
097      return new FolderReferenceV2025R0(this);
098    }
099  }
100}