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//www.java2s.com
*
* 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;
publicabstractclass Parameters
{
/**
* Parameters map
*/private HashMap<String, String> parameters;
/**
* Add parameter to map
* @param name Parameter name
* @param value Parameter value
*/protectedvoid 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
*/protectedvoid add(String name, Integer value)
{
if (value == null)
return;
parameters.put(name, value.toString());
}
/**
* Remove parameter from map
* @param name Parameter name
*/protectedvoid 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
*/protectedabstractvoid configureMap();
}