2 * Copyright (C) 2012 Andrew Neal
3 * Copyright (C) 2014 The CyanogenMod Project
4 * Licensed under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with the
6 * License. You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
8 * or agreed to in writing, software distributed under the License is
9 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
10 * KIND, either express or implied. See the License for the specific language
11 * governing permissions and limitations under the License.
14 package com.cyanogenmod.eleven.model;
16 import android.text.TextUtils;
19 * A class that represents an artist.
21 * @author Andrew Neal (andrewdneal@gmail.com)
26 * The unique Id of the artist
28 public long mArtistId;
33 public String mArtistName;
36 * The number of albums for the artist
38 public int mAlbumNumber;
41 * The number of songs for the artist
43 public int mSongNumber;
46 * Bucket label for the artist name if it exists
48 public String mBucketLabel;
51 * Constructor of <code>Artist</code>
53 * @param artistId The Id of the artist
54 * @param artistName The artist name
55 * @param songNumber The number of songs for the artist
56 * @param albumNumber The number of albums for the artist
58 public Artist(final long artistId, final String artistName, final int songNumber,
59 final int albumNumber) {
62 mArtistName = artistName;
63 mSongNumber = songNumber;
64 mAlbumNumber = albumNumber;
71 public int hashCode() {
74 result = prime * result + mAlbumNumber;
75 result = prime * result + (int) mArtistId;
76 result = prime * result + (mArtistName == null ? 0 : mArtistName.hashCode());
77 result = prime * result + mSongNumber;
85 public boolean equals(final Object obj) {
92 if (getClass() != obj.getClass()) {
95 final Artist other = (Artist)obj;
96 if (mAlbumNumber != other.mAlbumNumber) {
99 if (mArtistId != other.mArtistId) {
102 if (!TextUtils.equals(mArtistName, other.mArtistName)) {
105 if (mSongNumber != other.mSongNumber) {
115 public String toString() {