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