001package com.box.sdkgen.schemas.shieldinformationbarriersegmentrestrictionmini; 002 003import com.box.sdkgen.schemas.shieldinformationbarriersegmentrestrictionbase.ShieldInformationBarrierSegmentRestrictionBase; 004import com.box.sdkgen.schemas.shieldinformationbarriersegmentrestrictionbase.ShieldInformationBarrierSegmentRestrictionBaseTypeField; 005import com.box.sdkgen.serialization.json.EnumWrapper; 006import com.fasterxml.jackson.annotation.JsonFilter; 007import com.fasterxml.jackson.annotation.JsonProperty; 008import java.util.Objects; 009 010/** A mini representation of a segment restriction object for the shield information barrier. */ 011@JsonFilter("nullablePropertyFilter") 012public class ShieldInformationBarrierSegmentRestrictionMini 013 extends ShieldInformationBarrierSegmentRestrictionBase { 014 015 /** The `type` and `id` of the requested shield information barrier segment. */ 016 @JsonProperty("shield_information_barrier_segment") 017 protected final ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField 018 shieldInformationBarrierSegment; 019 020 /** The `type` and `id` of the restricted shield information barrier segment. */ 021 @JsonProperty("restricted_segment") 022 protected final ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField 023 restrictedSegment; 024 025 public ShieldInformationBarrierSegmentRestrictionMini( 026 @JsonProperty("shield_information_barrier_segment") 027 ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField 028 shieldInformationBarrierSegment, 029 @JsonProperty("restricted_segment") 030 ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField restrictedSegment) { 031 super(); 032 this.shieldInformationBarrierSegment = shieldInformationBarrierSegment; 033 this.restrictedSegment = restrictedSegment; 034 } 035 036 protected ShieldInformationBarrierSegmentRestrictionMini(Builder builder) { 037 super(builder); 038 this.shieldInformationBarrierSegment = builder.shieldInformationBarrierSegment; 039 this.restrictedSegment = builder.restrictedSegment; 040 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 041 } 042 043 public ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField 044 getShieldInformationBarrierSegment() { 045 return shieldInformationBarrierSegment; 046 } 047 048 public ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField 049 getRestrictedSegment() { 050 return restrictedSegment; 051 } 052 053 @Override 054 public boolean equals(Object o) { 055 if (this == o) { 056 return true; 057 } 058 if (o == null || getClass() != o.getClass()) { 059 return false; 060 } 061 ShieldInformationBarrierSegmentRestrictionMini casted = 062 (ShieldInformationBarrierSegmentRestrictionMini) o; 063 return Objects.equals(type, casted.type) 064 && Objects.equals(id, casted.id) 065 && Objects.equals(shieldInformationBarrierSegment, casted.shieldInformationBarrierSegment) 066 && Objects.equals(restrictedSegment, casted.restrictedSegment); 067 } 068 069 @Override 070 public int hashCode() { 071 return Objects.hash(type, id, shieldInformationBarrierSegment, restrictedSegment); 072 } 073 074 @Override 075 public String toString() { 076 return "ShieldInformationBarrierSegmentRestrictionMini{" 077 + "type='" 078 + type 079 + '\'' 080 + ", " 081 + "id='" 082 + id 083 + '\'' 084 + ", " 085 + "shieldInformationBarrierSegment='" 086 + shieldInformationBarrierSegment 087 + '\'' 088 + ", " 089 + "restrictedSegment='" 090 + restrictedSegment 091 + '\'' 092 + "}"; 093 } 094 095 public static class Builder extends ShieldInformationBarrierSegmentRestrictionBase.Builder { 096 097 protected final 098 ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField 099 shieldInformationBarrierSegment; 100 101 protected final ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField 102 restrictedSegment; 103 104 public Builder( 105 ShieldInformationBarrierSegmentRestrictionMiniShieldInformationBarrierSegmentField 106 shieldInformationBarrierSegment, 107 ShieldInformationBarrierSegmentRestrictionMiniRestrictedSegmentField restrictedSegment) { 108 super(); 109 this.shieldInformationBarrierSegment = shieldInformationBarrierSegment; 110 this.restrictedSegment = restrictedSegment; 111 } 112 113 @Override 114 public Builder type(ShieldInformationBarrierSegmentRestrictionBaseTypeField type) { 115 this.type = new EnumWrapper<ShieldInformationBarrierSegmentRestrictionBaseTypeField>(type); 116 return this; 117 } 118 119 @Override 120 public Builder type(EnumWrapper<ShieldInformationBarrierSegmentRestrictionBaseTypeField> type) { 121 this.type = type; 122 return this; 123 } 124 125 @Override 126 public Builder id(String id) { 127 this.id = id; 128 return this; 129 } 130 131 public ShieldInformationBarrierSegmentRestrictionMini build() { 132 return new ShieldInformationBarrierSegmentRestrictionMini(this); 133 } 134 } 135}