Cylone

A light-weight library to convert pojos

Лицензия

Лицензия

Категории

Категории

Сеть
Группа

Группа

net.meku.cylone
Идентификатор

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

cylone-core
Последняя версия

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

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Cylone
A light-weight library to convert pojos
Ссылка на сайт

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

https://github.com/shoopman/cylone
Система контроля версий

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

https://github.com/shoopman/cylone

Скачать cylone-core

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

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

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.apache.commons : commons-lang3 jar 3.8.1
org.springframework.data : spring-data-commons jar 2.1.10.RELEASE
org.slf4j : slf4j-simple jar 1.7.25

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

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

Introduction

Cyclone is a light-weight library to convert pojos.

Usage

Introduce to your project

Gradle build.gradle

    compile("net.meku.cylone:cylone:1.0-SNAPSHOT")

Maven pom.xml

	<dependency>
		<groupId>net.meku.cylone</groupId>
		<artifactId>cylone</artifactId>
		<version>1.0-SNAPSHOT</version>
	</dependency>
        

Convert your pojos

First, create your own converters.

public class AttachmentConverter extends BeanCopyPojoConverter<Attachment, AttachmentView> {
    
    protected void afterBeanCopy(AttachmentView source, Attachment target) {
        // do something
    }
}

Now you can convert your pojos.

    AttachmentConverter converter = new AttachmentConverter();
    Attachment model = converter.toPojo(view);
    List<Attachment> models = converter.toList(views);

Use SimpleConverter if you only have simple properties to pass between pojos.

    SimpleConverter<Article, ArticleView> converter = new SimpleConverter<>();
    Article model = new Article();
    converter.toPojo(view, model);

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

Версия
1.0.0