2 * Copyright (C) 2012 Andrew Neal Licensed under the Apache License, Version 2.0
3 * (the "License"); you may not use this file except in compliance with the
4 * License. You may obtain a copy of the License at
5 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
6 * or agreed to in writing, software distributed under the License is
7 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 * KIND, either express or implied. See the License for the specific language
9 * governing permissions and limitations under the License.
12 package com.andrew.apollo.model;
14 import android.text.TextUtils;
17 * A class that represents a genre.
19 * @author Andrew Neal (andrewdneal@gmail.com)
24 * The unique Id of the genre
31 public String mGenreName;
34 * Constructor of <code>Genre</code>
36 * @param genreId The Id of the genre
37 * @param genreName The genre name
39 public Genre(final long genreId, final String genreName) {
42 mGenreName = genreName;
49 public int hashCode() {
52 result = prime * result + (int) mGenreId;
53 result = prime * result + (mGenreName == null ? 0 : mGenreName.hashCode());
61 public boolean equals(final Object obj) {
68 if (getClass() != obj.getClass()) {
71 final Genre other = (Genre)obj;
72 if (mGenreId != other.mGenreId) {
75 return TextUtils.equals(mGenreName, other.mGenreName);
82 public String toString() {