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