All Projects → ZieIony → Randomdata

ZieIony / Randomdata

Licence: apache-2.0
Random data generator

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Randomdata

walletconnect-test-wallet
Test Wallet (Web)
Stars: ✭ 163 (+3.82%)
Mutual labels:  mock, sample
falso
All the Fake Data for All Your Real Needs 🙂
Stars: ✭ 877 (+458.6%)
Mutual labels:  mock, random
Handyswift
Handy Swift features that didn't make it into the Swift standard library.
Stars: ✭ 403 (+156.69%)
Mutual labels:  sample, random
Smoke
💨 Simple yet powerful file-based mock server with recording abilities
Stars: ✭ 142 (-9.55%)
Mutual labels:  mock
Pandemonium
Typical random-related functions for JavaScript and TypeScript.
Stars: ✭ 144 (-8.28%)
Mutual labels:  random
Mockingbird
Simplify software testing, by easily mocking any system using HTTP/HTTPS, allowing a team to test and develop against a service that is not complete or is unstable or just to reproduce planned/edge cases.
Stars: ✭ 149 (-5.1%)
Mutual labels:  mock
Gunit
GUnit - Google.Test/Google.Mock/Cucumber on steroids
Stars: ✭ 156 (-0.64%)
Mutual labels:  mock
Android Mvp Basic Sample
Android MVP Basic Sample
Stars: ✭ 140 (-10.83%)
Mutual labels:  sample
Aeromock
Lightweight mock web application server
Stars: ✭ 152 (-3.18%)
Mutual labels:  mock
Morphlingjs
A CLI to mock with meaningful data a REST API from a Swagger file
Stars: ✭ 148 (-5.73%)
Mutual labels:  mock
Jnanoid
A unique string ID generator for Java.
Stars: ✭ 147 (-6.37%)
Mutual labels:  random
Vue Cli Multi Page
基于vue-cli模板的多页面多路由项目,一个PC端页面入口,一个移动端页面入口,且有各自的路由, vue+webpack+vue-router+vuex+mock+axios
Stars: ✭ 145 (-7.64%)
Mutual labels:  mock
Easyfun
a project using react antd webpack es6
Stars: ✭ 150 (-4.46%)
Mutual labels:  mock
Generatedata
A powerful, feature-rich, random test data generator.
Stars: ✭ 1,883 (+1099.36%)
Mutual labels:  random
Play Scala Isolated Slick Example
Example Play Slick Project
Stars: ✭ 155 (-1.27%)
Mutual labels:  sample
Gofakeit
Random fake data generator written in go
Stars: ✭ 2,193 (+1296.82%)
Mutual labels:  random
Pyentropy
Entropy for Python
Stars: ✭ 149 (-5.1%)
Mutual labels:  sample
Weld
Full fake REST API generator written with Rust
Stars: ✭ 146 (-7.01%)
Mutual labels:  mock
Spring Petclinic Angular
Angular 8 version of the Spring Petclinic sample application (frontend)
Stars: ✭ 145 (-7.64%)
Mutual labels:  sample
Mvvmrxjavaretrofitsample
MVVM RxJava Retrofit Sample
Stars: ✭ 148 (-5.73%)
Mutual labels:  sample

RandomData

Your test/mock screens would look much better with some real data. RandomData automatically fills your structures with generated, random names, numbers, images, etc. RandomData uses data libraries, validating algorithms and keeps track of a context to make sure that every bit of generated data is consistent and makes sense. Did you notice that a female name always comes with a picture of a woman? :)

Before you start, make sure to check out https://www.pexels.com/ - very nice site with free stock photos :)

Screenshot Screenshot2

Setup

Visit Jitpack for installation instructions.

Add RandomData to your project's dependencies. Select only modules you need (because of their size):

dependencies {
    implementation 'com.github.ZieIony.RandomData:person:-SNAPSHOT'
}

Usage

Prepare a data class:

public class User{
    Drawable avatar;
    String name, subtext, date;
    
    @Ignore
    Parcelable parcelable;  // don't fill this field
    
    final static int TYPE_ID = 5;   // ignored automatically
}

Constructor parameters don't have names on Java below 1.8. Use RandomValue annotation to provide names.

data class CreditCardItem(
        @RandomValue(name = "name")
        val name: String,
        @RandomValue(name = "number")
        val number: String,
        @RandomValue(name = "amount")
        val amount: String,
        @RandomValue(name = "image")
        val image: Drawable,
        @RandomValue(name = "validity")
        val validity: Validity
) : Serializable

Setup RandomData with generators you need:

randomData = new RandomData();
randomData.addGenerator(String.class, new StringNameGenerator(Gender.Both).withMatcher(f -> f.getName().equals("text") && f.getDeclaringClass().equals(DefaultAvatarTextSubtextDateItem.class) || f.getName().equals("name")));
randomData.addGenerator(String.class, new TextGenerator().withMatcher(f -> f.getName().equals("subtext")));
randomData.addGenerator(Drawable.class, new DrawableAvatarGenerator(this));
randomData.addGenerator(String.class, new DateGenerator().withTransformer(new DateToStringTransformer()));
randomData.addGenerator(String.class, new StringCardNumberGenerator());
randomData.addGenerator(String.class, new StringAmountGenerator());
randomData.addGenerator(Drawable.class, new DrawableImageGenerator(this).withMatcher(f -> f.getName().equals("image")));
randomData.addGenerator(Validity.class, new EnumGenerator<>(Validity.class));
randomData.addGenerator(Float.class, new FloatGenerator());

Fill or generate your objects with data. There's no need to initialize arrays:

User[] items = new User[10];
randomData.fill(items);

CreditCardItem creditCard = randomData.generate(CreditCardItem.class);

Modules

Common
  • picture
  • date
  • id
  • hash
  • lorem ipsum
Person
  • avatar
  • name
  • email
  • gender
  • phone number
  • age
Finance
  • amount
  • card number

FAQ

1. Where did you get these nice recycler rows from?

It's Carbon. RandomData helps me with carbon.components package.

2. I need a generator you don't have

Open an issue and describe your generator. I'll try to add it.

3. I've coded a generator. Can I make a pull request?

Sure thing!

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].