Code Monkey home page Code Monkey logo

newdataclassaction's Introduction

NewDataClassAction

This is an IntelliJ plugin for Kotlin. You may use this to create a data class from a Json string.

This is mainly inspired by GsonFormat, a great Java Bean code generator from Json.

Download

This plugin is still pending approval and not yet ready to download from JetBrains Repo.

Preview distribution is here, download and install it from local file. Feel free to leave an issue.

Usage

Related Project

GsonFormat

License

Copyright 2017 Bennyhuo

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.

newdataclassaction's People

Contributors

bennyhuo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

newdataclassaction's Issues

格式化时候有些属性会加上符号

data class Data(var id: Int,
                    var `type`: Int,
                    var animate: Int,
                    var duration: Int,
                    var start_time: Int,
                    var end_time: Int,
                    var thumb: String,
                    var hash: String,
                    var times: Int,
                    var skip: Int,
                    var uri: String)

就是这个type, 去掉符号也没影响

支持基本类型的默认值

例如生成的 val name: String 可以设置生成 val name: String = "",对于有些情况可能会比较友好。

生成的类可以不是内部类

例如 Repository 这个类当中有个 Owner 的字段,这个字段生成的类现在是作为内部类出现的,应允许不作为内部类存在。

原因:Realm 不支持内部类。

支持生成 Parcelable 的 data class

主要是需要处理一下 null 的问题。例如对于不可空类型的变量 var name: String,反序列化时如果读到的是 null(这是有可能的),给定一个默认值

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.