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