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