001package com.box.sdkgen.schemas.metadatataxonomyancestor; 002 003import com.box.sdkgen.internal.NullableFieldTracker; 004import com.box.sdkgen.internal.SerializableObject; 005import com.fasterxml.jackson.annotation.JsonFilter; 006import java.util.Objects; 007 008/** A node object in the metadata taxonomy that represents an ancestor. */ 009@JsonFilter("nullablePropertyFilter") 010public class MetadataTaxonomyAncestor extends SerializableObject { 011 012 /** A unique identifier of the metadata taxonomy node. */ 013 protected String id; 014 015 /** The display name of the metadata taxonomy node. */ 016 protected String displayName; 017 018 /** An index of the level to which the node belongs. */ 019 protected Long level; 020 021 public MetadataTaxonomyAncestor() { 022 super(); 023 } 024 025 protected MetadataTaxonomyAncestor(Builder builder) { 026 super(); 027 this.id = builder.id; 028 this.displayName = builder.displayName; 029 this.level = builder.level; 030 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 031 } 032 033 public String getId() { 034 return id; 035 } 036 037 public String getDisplayName() { 038 return displayName; 039 } 040 041 public Long getLevel() { 042 return level; 043 } 044 045 @Override 046 public boolean equals(Object o) { 047 if (this == o) { 048 return true; 049 } 050 if (o == null || getClass() != o.getClass()) { 051 return false; 052 } 053 MetadataTaxonomyAncestor casted = (MetadataTaxonomyAncestor) o; 054 return Objects.equals(id, casted.id) 055 && Objects.equals(displayName, casted.displayName) 056 && Objects.equals(level, casted.level); 057 } 058 059 @Override 060 public int hashCode() { 061 return Objects.hash(id, displayName, level); 062 } 063 064 @Override 065 public String toString() { 066 return "MetadataTaxonomyAncestor{" 067 + "id='" 068 + id 069 + '\'' 070 + ", " 071 + "displayName='" 072 + displayName 073 + '\'' 074 + ", " 075 + "level='" 076 + level 077 + '\'' 078 + "}"; 079 } 080 081 public static class Builder extends NullableFieldTracker { 082 083 protected String id; 084 085 protected String displayName; 086 087 protected Long level; 088 089 public Builder id(String id) { 090 this.id = id; 091 return this; 092 } 093 094 public Builder displayName(String displayName) { 095 this.displayName = displayName; 096 return this; 097 } 098 099 public Builder level(Long level) { 100 this.level = level; 101 return this; 102 } 103 104 public MetadataTaxonomyAncestor build() { 105 return new MetadataTaxonomyAncestor(this); 106 } 107 } 108}