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