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