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