001package com.box.sdkgen.schemas.metadatataxonomylevel; 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/** 009 * A level in the metadata taxonomy represents a hierarchical category within the taxonomy 010 * structure. 011 */ 012@JsonFilter("nullablePropertyFilter") 013public class MetadataTaxonomyLevel extends SerializableObject { 014 015 /** The display name of the level as it is shown to the user. */ 016 protected String displayName; 017 018 /** A description of the level. */ 019 protected String description; 020 021 /** An index of the level within the taxonomy. Levels are indexed starting from 1. */ 022 protected Integer level; 023 024 public MetadataTaxonomyLevel() { 025 super(); 026 } 027 028 protected MetadataTaxonomyLevel(Builder builder) { 029 super(); 030 this.displayName = builder.displayName; 031 this.description = builder.description; 032 this.level = builder.level; 033 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 034 } 035 036 public String getDisplayName() { 037 return displayName; 038 } 039 040 public String getDescription() { 041 return description; 042 } 043 044 public Integer getLevel() { 045 return level; 046 } 047 048 @Override 049 public boolean equals(Object o) { 050 if (this == o) { 051 return true; 052 } 053 if (o == null || getClass() != o.getClass()) { 054 return false; 055 } 056 MetadataTaxonomyLevel casted = (MetadataTaxonomyLevel) o; 057 return Objects.equals(displayName, casted.displayName) 058 && Objects.equals(description, casted.description) 059 && Objects.equals(level, casted.level); 060 } 061 062 @Override 063 public int hashCode() { 064 return Objects.hash(displayName, description, level); 065 } 066 067 @Override 068 public String toString() { 069 return "MetadataTaxonomyLevel{" 070 + "displayName='" 071 + displayName 072 + '\'' 073 + ", " 074 + "description='" 075 + description 076 + '\'' 077 + ", " 078 + "level='" 079 + level 080 + '\'' 081 + "}"; 082 } 083 084 public static class Builder extends NullableFieldTracker { 085 086 protected String displayName; 087 088 protected String description; 089 090 protected Integer level; 091 092 public Builder displayName(String displayName) { 093 this.displayName = displayName; 094 return this; 095 } 096 097 public Builder description(String description) { 098 this.description = description; 099 return this; 100 } 101 102 public Builder level(Integer level) { 103 this.level = level; 104 return this; 105 } 106 107 public MetadataTaxonomyLevel build() { 108 return new MetadataTaxonomyLevel(this); 109 } 110 } 111}