001package com.box.sdkgen.schemas.v2025r0.shieldlistcontentcountryv2025r0; 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.List; 011import java.util.Objects; 012 013/** Representation of content of a Shield List that contains countries data. */ 014@JsonFilter("nullablePropertyFilter") 015public class ShieldListContentCountryV2025R0 extends SerializableObject { 016 017 /** The type of content in the shield list. */ 018 @JsonDeserialize( 019 using = 020 ShieldListContentCountryV2025R0TypeField 021 .ShieldListContentCountryV2025R0TypeFieldDeserializer.class) 022 @JsonSerialize( 023 using = 024 ShieldListContentCountryV2025R0TypeField 025 .ShieldListContentCountryV2025R0TypeFieldSerializer.class) 026 protected EnumWrapper<ShieldListContentCountryV2025R0TypeField> type; 027 028 /** List of country codes values. */ 029 @JsonProperty("country_codes") 030 protected final List<String> countryCodes; 031 032 public ShieldListContentCountryV2025R0(@JsonProperty("country_codes") List<String> countryCodes) { 033 super(); 034 this.countryCodes = countryCodes; 035 this.type = 036 new EnumWrapper<ShieldListContentCountryV2025R0TypeField>( 037 ShieldListContentCountryV2025R0TypeField.COUNTRY); 038 } 039 040 protected ShieldListContentCountryV2025R0(Builder builder) { 041 super(); 042 this.type = builder.type; 043 this.countryCodes = builder.countryCodes; 044 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 045 } 046 047 public EnumWrapper<ShieldListContentCountryV2025R0TypeField> getType() { 048 return type; 049 } 050 051 public List<String> getCountryCodes() { 052 return countryCodes; 053 } 054 055 @Override 056 public boolean equals(Object o) { 057 if (this == o) { 058 return true; 059 } 060 if (o == null || getClass() != o.getClass()) { 061 return false; 062 } 063 ShieldListContentCountryV2025R0 casted = (ShieldListContentCountryV2025R0) o; 064 return Objects.equals(type, casted.type) && Objects.equals(countryCodes, casted.countryCodes); 065 } 066 067 @Override 068 public int hashCode() { 069 return Objects.hash(type, countryCodes); 070 } 071 072 @Override 073 public String toString() { 074 return "ShieldListContentCountryV2025R0{" 075 + "type='" 076 + type 077 + '\'' 078 + ", " 079 + "countryCodes='" 080 + countryCodes 081 + '\'' 082 + "}"; 083 } 084 085 public static class Builder extends NullableFieldTracker { 086 087 protected EnumWrapper<ShieldListContentCountryV2025R0TypeField> type; 088 089 protected final List<String> countryCodes; 090 091 public Builder(List<String> countryCodes) { 092 super(); 093 this.countryCodes = countryCodes; 094 } 095 096 public Builder type(ShieldListContentCountryV2025R0TypeField type) { 097 this.type = new EnumWrapper<ShieldListContentCountryV2025R0TypeField>(type); 098 return this; 099 } 100 101 public Builder type(EnumWrapper<ShieldListContentCountryV2025R0TypeField> type) { 102 this.type = type; 103 return this; 104 } 105 106 public ShieldListContentCountryV2025R0 build() { 107 if (this.type == null) { 108 this.type = 109 new EnumWrapper<ShieldListContentCountryV2025R0TypeField>( 110 ShieldListContentCountryV2025R0TypeField.COUNTRY); 111 } 112 return new ShieldListContentCountryV2025R0(this); 113 } 114 } 115}