001package com.box.sdkgen.schemas.legalholdpolicyassigneditem; 002 003import com.box.sdkgen.internal.SerializableObject; 004import com.box.sdkgen.serialization.json.EnumWrapper; 005import com.fasterxml.jackson.annotation.JsonFilter; 006import com.fasterxml.jackson.annotation.JsonProperty; 007import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 008import com.fasterxml.jackson.databind.annotation.JsonSerialize; 009import java.util.Objects; 010 011/** The item that the legal hold policy is assigned to. Includes type and ID. */ 012@JsonFilter("nullablePropertyFilter") 013public class LegalHoldPolicyAssignedItem extends SerializableObject { 014 015 /** The type of item the policy is assigned to. */ 016 @JsonDeserialize( 017 using = 018 LegalHoldPolicyAssignedItemTypeField.LegalHoldPolicyAssignedItemTypeFieldDeserializer 019 .class) 020 @JsonSerialize( 021 using = 022 LegalHoldPolicyAssignedItemTypeField.LegalHoldPolicyAssignedItemTypeFieldSerializer.class) 023 protected final EnumWrapper<LegalHoldPolicyAssignedItemTypeField> type; 024 025 /** The ID of the item the policy is assigned to. */ 026 protected final String id; 027 028 public LegalHoldPolicyAssignedItem(LegalHoldPolicyAssignedItemTypeField type, String id) { 029 super(); 030 this.type = new EnumWrapper<LegalHoldPolicyAssignedItemTypeField>(type); 031 this.id = id; 032 } 033 034 public LegalHoldPolicyAssignedItem( 035 @JsonProperty("type") EnumWrapper<LegalHoldPolicyAssignedItemTypeField> type, 036 @JsonProperty("id") String id) { 037 super(); 038 this.type = type; 039 this.id = id; 040 } 041 042 public EnumWrapper<LegalHoldPolicyAssignedItemTypeField> getType() { 043 return type; 044 } 045 046 public String getId() { 047 return id; 048 } 049 050 @Override 051 public boolean equals(Object o) { 052 if (this == o) { 053 return true; 054 } 055 if (o == null || getClass() != o.getClass()) { 056 return false; 057 } 058 LegalHoldPolicyAssignedItem casted = (LegalHoldPolicyAssignedItem) o; 059 return Objects.equals(type, casted.type) && Objects.equals(id, casted.id); 060 } 061 062 @Override 063 public int hashCode() { 064 return Objects.hash(type, id); 065 } 066 067 @Override 068 public String toString() { 069 return "LegalHoldPolicyAssignedItem{" 070 + "type='" 071 + type 072 + '\'' 073 + ", " 074 + "id='" 075 + id 076 + '\'' 077 + "}"; 078 } 079}