@@ -0,0 +1,2393 @@
+package com.marverenic.music.instances.playlistrules;%0A%0Aimport android.os.Parcel;%0Aimport android.os.Parcelable;%0A%0Aimport com.marverenic.music.data.store.MusicStore;%0Aimport com.marverenic.music.data.store.PlayCountStore;%0Aimport com.marverenic.music.data.store.PlaylistStore;%0Aimport com.marverenic.music.instances.Song;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport rx.Observable;%0A%0Apublic class SongRule extends AutoPlaylistRule implements Parcelable %7B%0A%0A    protected SongRule(@Field int field, @Match int match, String value) %7B%0A        super(AutoPlaylistRule.SONG, field, match, value);%0A    %7D%0A%0A    protected SongRule(Parcel in) %7B%0A        super(in);%0A    %7D%0A%0A    @Override%0A    public Observable%3CList%3CSong%3E%3E applyFilter(PlaylistStore playlistStore, MusicStore musicStore,%0A                                              PlayCountStore playCountStore) %7B%0A        return musicStore.getSongs()%0A                .map(library -%3E %7B%0A                    List%3CSong%3E filtered = new ArrayList%3C%3E();%0A                    for (Song song : library) %7B%0A                        if (includeSong(song, playCountStore)) %7B%0A                            filtered.add(song);%0A                        %7D%0A                    %7D%0A                    return filtered;%0A                %7D);%0A    %7D%0A%0A    private boolean includeSong(Song song, PlayCountStore playCountStore) %7B%0A        switch (getField()) %7B%0A            case ID:%0A                return checkId(song.getSongId());%0A            case NAME:%0A                return checkString(song.getSongName());%0A            case PLAY_COUNT:%0A                return checkInt(playCountStore.getPlayCount(song));%0A            case SKIP_COUNT:%0A                return checkInt(playCountStore.getPlayCount(song));%0A            case YEAR:%0A                return checkInt(song.getYear());%0A            case DATE_ADDED:%0A                return checkInt(song.getDateAdded());%0A            case DATE_PLAYED:%0A                return checkInt(playCountStore.getPlayDate(song));%0A        %7D%0A        throw new IllegalArgumentException(%22Cannot compare against field %22 + getField());%0A    %7D%0A%0A    public static final Creator%3CSongRule%3E CREATOR = new Creator%3CSongRule%3E() %7B%0A        @Override%0A        public SongRule createFromParcel(Parcel in) %7B%0A            return new SongRule(in);%0A        %7D%0A%0A        @Override%0A        public SongRule%5B%5D newArray(int size) %7B%0A            return new SongRule%5Bsize%5D;%0A        %7D%0A    %7D;%0A%7D%0A

Create SongRule class