001package com.box.sdkgen.schemas.metadatafull; 002 003import com.box.sdkgen.schemas.metadata.Metadata; 004import com.fasterxml.jackson.annotation.JsonAnyGetter; 005import com.fasterxml.jackson.annotation.JsonAnySetter; 006import com.fasterxml.jackson.annotation.JsonFilter; 007import com.fasterxml.jackson.annotation.JsonProperty; 008import java.util.Map; 009import java.util.Objects; 010 011/** An instance of a metadata template, which has been applied to a file or folder. */ 012@JsonFilter("nullablePropertyFilter") 013public class MetadataFull extends Metadata { 014 015 /** Whether the user can edit this metadata instance. */ 016 @JsonProperty("$canEdit") 017 protected Boolean canEdit; 018 019 /** A UUID to identify the metadata instance. */ 020 @JsonProperty("$id") 021 protected String id; 022 023 /** 024 * A unique identifier for the "type" of this instance. This is an internal system property and 025 * should not be used by a client application. 026 */ 027 @JsonProperty("$type") 028 protected String type; 029 030 /** 031 * The last-known version of the template of the object. This is an internal system property and 032 * should not be used by a client application. 033 */ 034 @JsonProperty("$typeVersion") 035 protected Long typeVersion; 036 037 @JsonAnyGetter @JsonAnySetter protected Map<String, Object> extraData; 038 039 public MetadataFull() { 040 super(); 041 } 042 043 protected MetadataFull(Builder builder) { 044 super(builder); 045 this.canEdit = builder.canEdit; 046 this.id = builder.id; 047 this.type = builder.type; 048 this.typeVersion = builder.typeVersion; 049 this.extraData = builder.extraData; 050 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 051 } 052 053 public Boolean getCanEdit() { 054 return canEdit; 055 } 056 057 public String getId() { 058 return id; 059 } 060 061 public String getType() { 062 return type; 063 } 064 065 public Long getTypeVersion() { 066 return typeVersion; 067 } 068 069 public Map<String, Object> getExtraData() { 070 return extraData; 071 } 072 073 @Override 074 public boolean equals(Object o) { 075 if (this == o) { 076 return true; 077 } 078 if (o == null || getClass() != o.getClass()) { 079 return false; 080 } 081 MetadataFull casted = (MetadataFull) o; 082 return Objects.equals(parent, casted.parent) 083 && Objects.equals(template, casted.template) 084 && Objects.equals(scope, casted.scope) 085 && Objects.equals(version, casted.version) 086 && Objects.equals(canEdit, casted.canEdit) 087 && Objects.equals(id, casted.id) 088 && Objects.equals(type, casted.type) 089 && Objects.equals(typeVersion, casted.typeVersion) 090 && Objects.equals(extraData, casted.extraData); 091 } 092 093 @Override 094 public int hashCode() { 095 return Objects.hash( 096 parent, template, scope, version, canEdit, id, type, typeVersion, extraData); 097 } 098 099 @Override 100 public String toString() { 101 return "MetadataFull{" 102 + "parent='" 103 + parent 104 + '\'' 105 + ", " 106 + "template='" 107 + template 108 + '\'' 109 + ", " 110 + "scope='" 111 + scope 112 + '\'' 113 + ", " 114 + "version='" 115 + version 116 + '\'' 117 + ", " 118 + "canEdit='" 119 + canEdit 120 + '\'' 121 + ", " 122 + "id='" 123 + id 124 + '\'' 125 + ", " 126 + "type='" 127 + type 128 + '\'' 129 + ", " 130 + "typeVersion='" 131 + typeVersion 132 + '\'' 133 + ", " 134 + "extraData='" 135 + extraData 136 + '\'' 137 + "}"; 138 } 139 140 public static class Builder extends Metadata.Builder { 141 142 protected Boolean canEdit; 143 144 protected String id; 145 146 protected String type; 147 148 protected Long typeVersion; 149 150 protected Map<String, Object> extraData; 151 152 public Builder canEdit(Boolean canEdit) { 153 this.canEdit = canEdit; 154 return this; 155 } 156 157 public Builder id(String id) { 158 this.id = id; 159 return this; 160 } 161 162 public Builder type(String type) { 163 this.type = type; 164 return this; 165 } 166 167 public Builder typeVersion(Long typeVersion) { 168 this.typeVersion = typeVersion; 169 return this; 170 } 171 172 public Builder extraData(Map<String, Object> extraData) { 173 this.extraData = extraData; 174 return this; 175 } 176 177 @Override 178 public Builder parent(String parent) { 179 this.parent = parent; 180 return this; 181 } 182 183 @Override 184 public Builder template(String template) { 185 this.template = template; 186 return this; 187 } 188 189 @Override 190 public Builder scope(String scope) { 191 this.scope = scope; 192 return this; 193 } 194 195 @Override 196 public Builder version(Long version) { 197 this.version = version; 198 return this; 199 } 200 201 public MetadataFull build() { 202 return new MetadataFull(this); 203 } 204 } 205}