Android Open Source - pequeno-android-spotify Parameters






From Project

Back to project page pequeno-android-spotify.

License

The source code is released under:

Apache License

If you think the Android project pequeno-android-spotify listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/**
 * Copyright 2015 ze-pequeno//  w  ww  . j  a v  a2s.  c o m
 *
 * 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 com.pequeno.android.spotify.api.http.params;

import java.util.HashMap;
import java.util.Map;

public abstract class Parameters
{
    /**
     * Parameters map
     */
    private HashMap<String, String> parameters;

    /**
     * Add parameter to map  
     * @param name Parameter name 
     * @param value Parameter value 
     */
    protected void add(String name, String value)
    {
        if (value == null || value.isEmpty())
            return;
        parameters.put(name, value);
    }

    /**
     * Add parameter to map
     * @param name Parameter name
     * @param value Parameter value
     */
    protected void add(String name, Integer value)
    {
        if (value == null)
            return;
        parameters.put(name, value.toString());
    }

    /**
     * Remove parameter from map
     * @param name Parameter name
     */
    protected void remove(String name)
    {
        parameters.remove(name);
    }

    /**
     * Convert class to map
     * @return Parameters map
     */
    public Map<String, String> toMap()
    {
        parameters = new HashMap<>();
        configureMap();
        return parameters;
    }

    /**
     * Call to configure parameters map  
     */
    protected abstract void configureMap();
}




Java Source Code List

com.pequeno.android.spotify.api.business.AlbumSimplified.java
com.pequeno.android.spotify.api.business.Album.java
com.pequeno.android.spotify.api.business.ArtistSimplified.java
com.pequeno.android.spotify.api.business.Artist.java
com.pequeno.android.spotify.api.business.Copyright.java
com.pequeno.android.spotify.api.business.Error.java
com.pequeno.android.spotify.api.business.ExternalCollection.java
com.pequeno.android.spotify.api.business.ExternalId.java
com.pequeno.android.spotify.api.business.ExternalIds.java
com.pequeno.android.spotify.api.business.ExternalUrl.java
com.pequeno.android.spotify.api.business.ExternalUrls.java
com.pequeno.android.spotify.api.business.Followers.java
com.pequeno.android.spotify.api.business.Image.java
com.pequeno.android.spotify.api.business.Paging.java
com.pequeno.android.spotify.api.business.PlaylistSimplified.java
com.pequeno.android.spotify.api.business.PlaylistTrack.java
com.pequeno.android.spotify.api.business.PlaylistUri.java
com.pequeno.android.spotify.api.business.Playlist.java
com.pequeno.android.spotify.api.business.SavedTrack.java
com.pequeno.android.spotify.api.business.SpotifyUri.java
com.pequeno.android.spotify.api.business.TrackSimplified.java
com.pequeno.android.spotify.api.business.Track.java
com.pequeno.android.spotify.api.business.UserPrivate.java
com.pequeno.android.spotify.api.business.UserPublic.java
com.pequeno.android.spotify.api.business.Value.java
com.pequeno.android.spotify.api.business.enums.AlbumType.java
com.pequeno.android.spotify.api.business.enums.DatePrecision.java
com.pequeno.android.spotify.api.business.enums.IdentifierType.java
com.pequeno.android.spotify.api.business.enums.ProductType.java
com.pequeno.android.spotify.api.business.enums.SearchType.java
com.pequeno.android.spotify.api.business.enums.SpotifyType.java
com.pequeno.android.spotify.api.business.enums.UrlType.java
com.pequeno.android.spotify.api.http.SearchService.java
com.pequeno.android.spotify.api.http.params.Parameter.java
com.pequeno.android.spotify.api.http.params.Parameters.java
com.pequeno.android.spotify.api.http.params.SearchParameters.java
com.pequeno.android.spotify.api.http.responses.SearchResponse.java
com.pequeno.android.spotify.api.utils.EnumUtils.java
com.pequeno.android.spotify.app.roboguice.SpotifyAppModule.java
com.pequeno.android.spotify.app.roboguice.ui.HomeActivity.java
pequeno.android.spotify.api.ApplicationTest.java
pequeno.android.spotifyapi.ApplicationTest.java