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