https://github.com/cynnyx/auto-value-map
AutoValue Extension to add Map generation support
https://github.com/cynnyx/auto-value-map
annotation-processor autovalue autovalue-extension
Last synced: 10 months ago
JSON representation
AutoValue Extension to add Map generation support
- Host: GitHub
- URL: https://github.com/cynnyx/auto-value-map
- Owner: cynnyx
- License: apache-2.0
- Created: 2016-07-27T06:54:49.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-12T10:52:17.000Z (over 9 years ago)
- Last Synced: 2024-11-17T02:33:54.445Z (over 1 year ago)
- Topics: annotation-processor, autovalue, autovalue-extension
- Language: Java
- Size: 94.7 KB
- Stars: 55
- Watchers: 6
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# auto-value-map
AutoValue Extension to add Map generation support. Generates a `Map` where the keys are the field names and the values the related field values.
## Usage
Include the AutoValue: Map Extension in your project and add `public abstract Map toMap()` to any of your `@AutoValue` annotated classes.
```java
@AutoValue public abstract class Foo {
public abstract String bar();
public abstract Integer bar2();
public abstract Map toMap();
}
```
Now build your project and use the generated `toMap()` method in Foo.
## Download
Add a Gradle dependency:
```groovy
apt 'com.github.cynnyx:auto-value-map:1.0'
```
(Using the [android-apt](https://bitbucket.org/hvisser/android-apt) plugin)
## License
Copyright 2016 Cynny
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.