All Projects → oguzbabaoglu → auto-value-querymap

oguzbabaoglu / auto-value-querymap

Licence: other
AutoValue Extension to add QueryMap generation (Retrofit 2)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to auto-value-querymap

BakingApp
Udacity Android Developer Nanodegree, project 2.
Stars: ✭ 54 (+285.71%)
Mutual labels:  retrofit2, autovalue
auto-value-ignore-hash-equals
An extension for Google's AutoValue that omits fields from hashCode() & equals().
Stars: ✭ 17 (+21.43%)
Mutual labels:  autovalue-extension, autovalue
RxJava2Demo
RxJava 2.X Retrofit OkHttp demo
Stars: ✭ 29 (+107.14%)
Mutual labels:  retrofit2
ResDelivery-Hilt-Coroutines-Mvvm-Single-Activity
This is a Sample Single Activity App (Multi Fragments) that uses Dagger-Hilt, Coroutines Flows, Paging 3 & Mvvm Clean Architecture
Stars: ✭ 28 (+100%)
Mutual labels:  retrofit2
JADA
JADA - Just Another Dictionary App
Stars: ✭ 20 (+42.86%)
Mutual labels:  retrofit2
Sunset-hadith
Islamic app written with Kotlin, using KTOR + coroutines + flow + MVVM + Android Jetpack + Navigation component. Old version using RxJava + Retrofit + OKHttp
Stars: ✭ 26 (+85.71%)
Mutual labels:  retrofit2
wES
wES is set of open source Java ElasticSearch client and toolkits; Compact, yet highly customizable and powerful.
Stars: ✭ 27 (+92.86%)
Mutual labels:  retrofit2
RetrofitRxErrorHandler
Hardening Retrofit RxJaxa API Layer against random errors
Stars: ✭ 15 (+7.14%)
Mutual labels:  retrofit2
Android
Step by step guide for various components in android
Stars: ✭ 32 (+128.57%)
Mutual labels:  retrofit2
InstantAppStarter
Starter Project Structure for Android Instant app. https://blog.mindorks.com/android-mvp-architecture-with-instant-app-support-11ba48241a82
Stars: ✭ 44 (+214.29%)
Mutual labels:  retrofit2
MVPSamples
🚀(Java 版)快速搭建 MVP + RxJava + Retrofit + EventBus 的框架,方便快速开发新项目、减少开发成本。
Stars: ✭ 113 (+707.14%)
Mutual labels:  retrofit2
prometheus4j
Prometheus API Client for Java
Stars: ✭ 30 (+114.29%)
Mutual labels:  retrofit2
RetrofitRssConverterFactory
A Retrofit 2 converter which parses Rss feeds
Stars: ✭ 73 (+421.43%)
Mutual labels:  retrofit2
Android-Assignment
This assignment gives you basically a post list and its detail with comments.🚀
Stars: ✭ 32 (+128.57%)
Mutual labels:  retrofit2
StreamBox
直播聚合APP,包含熊猫tv,斗鱼tv,战旗tv,全民tv等等
Stars: ✭ 27 (+92.86%)
Mutual labels:  retrofit2
Clean-MVVM-NewsApp
Android News app developed using Clean + MVVM architecture
Stars: ✭ 52 (+271.43%)
Mutual labels:  retrofit2
Android-Code-Demos
📦 Android learning code demos.
Stars: ✭ 41 (+192.86%)
Mutual labels:  retrofit2
WanAndroid
wanandroid的Kotlin版,采用Android X
Stars: ✭ 20 (+42.86%)
Mutual labels:  retrofit2
MVVM-Koin-Repository-Pattern
Experimenting with MVVM, Koin and Repository pattern in a simple TODO app.
Stars: ✭ 29 (+107.14%)
Mutual labels:  retrofit2
Hibiscus
Hibiscus, mobile microblogging application.
Stars: ✭ 14 (+0%)
Mutual labels:  retrofit2

AutoValue: QueryMap Extension

An extension for Google's AutoValue that implements a "toQueryMap" method for Retrofit's QueryMap.

Usage

Include auto-value-querymap in your project and add a public abstract Map<String, String> toQueryMap() method to your @AutoValue annotated class.

You can also annotate your properties using @Param to define an alternate key name in the QueryMap.

@AutoValue public abstract class Foo {
  abstract String bar();                  // Will be mapped as "bar":"<value of bar>"
  @Param("Bazoo") abstract String baz();  // Will be mapped as "Bazoo":"<value of baz>"

  // This method is what auto-value-querymap will implement.
  public abstract Map<String, String> toQueryMap();
  
  // Retrofit will convert this to "?bar=<value of bar>&Bazoo=<value of baz>"
}

Now build your project and auto-value-querymap will implement the method.

  • null values will not be added to the map (Not allowed by QueryMap)
  • all values will be converted to String using String.valueOf()
  • the map will preserve order of decleration of the fields

Download

Android

Add a Gradle dependency to the apt and provided configuration.

apt 'com.oguzbabaoglu:auto-value-querymap:1.0'
provided 'com.oguzbabaoglu:auto-value-querymap:1.0'

(Using the android-apt plugin)

Java

Add a Gradle dependency to the apt and compileOnly configuration.

apt 'com.oguzbabaoglu:auto-value-querymap:1.0'
compileOnly 'com.oguzbabaoglu:auto-value-querymap:1.0'

(Using the gradle-apt-plugin plugin)

Credit

Based on the existing auto-value-map extension by Cynny.

License

Copyright 2016 Oguz Babaoglu.

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].