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