001package com.box.sdkgen.schemas.metadata; 002 003import com.box.sdkgen.schemas.metadatabase.MetadataBase; 004import com.fasterxml.jackson.annotation.JsonFilter; 005import java.util.Objects; 006 007/** An instance of a metadata template, which has been applied to a file or folder. */ 008@JsonFilter("nullablePropertyFilter") 009public class Metadata extends MetadataBase { 010 011 public Metadata() { 012 super(); 013 } 014 015 protected Metadata(Builder builder) { 016 super(builder); 017 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 018 } 019 020 @Override 021 public boolean equals(Object o) { 022 if (this == o) { 023 return true; 024 } 025 if (o == null || getClass() != o.getClass()) { 026 return false; 027 } 028 Metadata casted = (Metadata) o; 029 return Objects.equals(parent, casted.parent) 030 && Objects.equals(template, casted.template) 031 && Objects.equals(scope, casted.scope) 032 && Objects.equals(version, casted.version); 033 } 034 035 @Override 036 public int hashCode() { 037 return Objects.hash(parent, template, scope, version); 038 } 039 040 @Override 041 public String toString() { 042 return "Metadata{" 043 + "parent='" 044 + parent 045 + '\'' 046 + ", " 047 + "template='" 048 + template 049 + '\'' 050 + ", " 051 + "scope='" 052 + scope 053 + '\'' 054 + ", " 055 + "version='" 056 + version 057 + '\'' 058 + "}"; 059 } 060 061 public static class Builder extends MetadataBase.Builder { 062 063 @Override 064 public Builder parent(String parent) { 065 this.parent = parent; 066 return this; 067 } 068 069 @Override 070 public Builder template(String template) { 071 this.template = template; 072 return this; 073 } 074 075 @Override 076 public Builder scope(String scope) { 077 this.scope = scope; 078 return this; 079 } 080 081 @Override 082 public Builder version(Long version) { 083 this.version = version; 084 return this; 085 } 086 087 public Metadata build() { 088 return new Metadata(this); 089 } 090 } 091}