blob: 5198c2d9c9f7d5311d51a8c65fbce125ad436713 [file] [log] [blame]
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.arch.persistence.room.integration.testapp.vo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.PrimaryKey;
/**
* The toys of a pet.
*/
@Entity
public class Toy {
@PrimaryKey(autoGenerate = true)
private int mId;
private String mName;
private int mPetId;
public int getId() {
return mId;
}
public void setId(int id) {
mId = id;
}
public String getName() {
return mName;
}
public void setName(String name) {
mName = name;
}
public int getPetId() {
return mPetId;
}
public void setPetId(int petId) {
mPetId = petId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Toy toy = (Toy) o;
if (mId != toy.mId) return false;
if (mPetId != toy.mPetId) return false;
return mName != null ? mName.equals(toy.mName) : toy.mName == null;
}
@Override
public int hashCode() {
int result = mId;
result = 31 * result + (mName != null ? mName.hashCode() : 0);
result = 31 * result + mPetId;
return result;
}
}