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