simter-util

Simter Util

Лицензия

Лицензия

MIT
Группа

Группа

tech.simter
Идентификатор

Идентификатор

simter-util
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

simter-util
Simter Util
Ссылка на сайт

Ссылка на сайт

https://github.com/simter/simter-util
Организация-разработчик

Организация-разработчик

simter
Система контроля версий

Система контроля версий

https://github.com/simter/simter-util.git

Скачать simter-util

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/tech.simter/simter-util/ -->
<dependency>
    <groupId>tech.simter</groupId>
    <artifactId>simter-util</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/tech.simter/simter-util/
implementation 'tech.simter:simter-util:1.1.0'
// https://jarcasting.com/artifacts/tech.simter/simter-util/
implementation ("tech.simter:simter-util:1.1.0")
'tech.simter:simter-util:jar:1.1.0'
<dependency org="tech.simter" name="simter-util" rev="1.1.0">
  <artifact name="simter-util" type="jar" />
</dependency>
@Grapes(
@Grab(group='tech.simter', module='simter-util', version='1.1.0')
)
libraryDependencies += "tech.simter" % "simter-util" % "1.1.0"
[tech.simter/simter-util "1.1.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib Необязательный jar 1.3.40
org.jetbrains.kotlin : kotlin-reflect Необязательный jar 1.3.40
org.modelmapper : modelmapper Необязательный jar 2.3.2

test (2)

Идентификатор библиотеки Тип Версия
org.junit.jupiter : junit-jupiter jar
org.assertj : assertj-core jar 3.12.2

Модули Проекта

Данный проект не имеет модулей.

simter-util [中文]

Some util tools. Includes:

  • BeanUtils.assign : similar to JavaScript Object.assign method
  • XPathUtils : find xml node by standard xpath
  • RandomUtils : generate random Int or String, get a nextId

Installation

<dependency>
  <groupId>tech.simter</groupId>
  <artifactId>simter-util</artifactId>
  <version>1.0.0</version>
</dependency>

Requirement

  • Java 8+
  • ModelMapper 1+

Usage - BeanUtils.assign

Convert PO to DTO or reverse

UserPo po = new UserPo();
// set po property value
...
// convert to DTO instance
UserDto dto = BeanUtils.assign(UserDto.class, po);

If the DTO has the same property from multiple po, code should be like this:

UserDto dto = BeanUtils.assign(UserDto.class, po1, po2, ...);

The latter po property value will override the previous po property value.

Copy property value to target instance object

UserPo po = new UserPo();
// set po property value
...
// instance target instance
UserDto dto = new UserDto();

// copy po property value to the dto property
BeanUtils.assign(dto, po);

If the DTO has the same property from multiple po, code should be like this:

BeanUtils.assign(dto, po1, po2, ...);

The latter po property value will override the previous po property value.

Usage - XPathUtils

TODO.

Build

mvn clean package

Deploy

First take a look at simter-parent deploy config.

Deploy to LAN Nexus Repository

mvn clean deploy -P lan

Deploy to Sonatype Repository

mvn clean deploy -P sonatype

After deployed, login into https://oss.sonatype.org. Through Staging Repositories, search this package, then close and release it. After couple hours, it will be synced to Maven Central Repository.

Deploy to Bintray Repository

mvn clean deploy -P bintray

Will deploy to https://api.bintray.com/maven/simter/maven/tech.simter:simter-util/;publish=1. So first create a package https://bintray.com/simter/maven/tech.simter:simter-util on Bintray. After deployed, check it from https://jcenter.bintray.com/tech/simter/simter-util.

tech.simter

Версии библиотеки

Версия
1.1.0
1.0.0
0.4.0
0.3.0