001package com.box.sdkgen.schemas.metadatatemplate; 002 003import com.box.sdkgen.internal.NullableFieldTracker; 004import com.box.sdkgen.internal.SerializableObject; 005import com.fasterxml.jackson.annotation.JsonFilter; 006import com.fasterxml.jackson.annotation.JsonProperty; 007import java.util.Objects; 008 009@JsonFilter("nullablePropertyFilter") 010public class MetadataTemplateFieldsOptionsField extends SerializableObject { 011 012 /** 013 * The text value of the option. This represents both the display name of the option and the 014 * internal key used when updating templates. 015 */ 016 protected final String key; 017 018 /** The internal unique identifier of the option. */ 019 protected String id; 020 021 public MetadataTemplateFieldsOptionsField(@JsonProperty("key") String key) { 022 super(); 023 this.key = key; 024 } 025 026 protected MetadataTemplateFieldsOptionsField(Builder builder) { 027 super(); 028 this.key = builder.key; 029 this.id = builder.id; 030 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 031 } 032 033 public String getKey() { 034 return key; 035 } 036 037 public String getId() { 038 return id; 039 } 040 041 @Override 042 public boolean equals(Object o) { 043 if (this == o) { 044 return true; 045 } 046 if (o == null || getClass() != o.getClass()) { 047 return false; 048 } 049 MetadataTemplateFieldsOptionsField casted = (MetadataTemplateFieldsOptionsField) o; 050 return Objects.equals(key, casted.key) && Objects.equals(id, casted.id); 051 } 052 053 @Override 054 public int hashCode() { 055 return Objects.hash(key, id); 056 } 057 058 @Override 059 public String toString() { 060 return "MetadataTemplateFieldsOptionsField{" 061 + "key='" 062 + key 063 + '\'' 064 + ", " 065 + "id='" 066 + id 067 + '\'' 068 + "}"; 069 } 070 071 public static class Builder extends NullableFieldTracker { 072 073 protected final String key; 074 075 protected String id; 076 077 public Builder(String key) { 078 super(); 079 this.key = key; 080 } 081 082 public Builder id(String id) { 083 this.id = id; 084 return this; 085 } 086 087 public MetadataTemplateFieldsOptionsField build() { 088 return new MetadataTemplateFieldsOptionsField(this); 089 } 090 } 091}