Skip to content

comchangs/jsend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsend

A library used for generating Json String of JSend

Maven Central

Setting

Maven

<dependency>
  <groupId>work.jeong.murry.jsend</groupId>
  <artifactId>jsend</artifactId>
  <version>1.0</version>
</dependency>

Gradle

dependencies {
    implementation("work.jeong.murry.jsend", "jsend", "{latest_version}")
}

Usage

sucess

    JSend success = JSend.success();

or

    Pet pet = new Pet("moon");
    JSend success = JSend.success(pet);

error

    JSend error = JSend.error("It has been occurred an error.");

or

    Pet pet = new Pet("moon");
    JSend error = JSend.error(500, "It has been occurred an error.", pet);

fail

    Pet pet = new Pet("moon");
    JSend fail = JSend.fail(pet);