Skip to content

General use class which copies properties between objects from same or different types

License

Notifications You must be signed in to change notification settings

ericbreno/FieldsCopier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FieldsCopier

General use class which copies properties between objects from same or different types.

Copy all properties with equal names from one to another object, even with different types. You can pass the destination object for the copy or it's type, which requires to have an empty constructor.

Examples

Copy properties from a type A object to another type B object

A orig;
B dest;
FieldsCopier.copy(dest, orig);

Or pass only B type

A orig;
B dest = FieldsCopier.copyTo(orig, B.class);

Running the tests

To run tests

mvn test

Installing

Maven

FieldsCopier with maven

Add the repository

<repository>
    <id>FieldsCopier-mvn-repo</id>
    <url>https://raw.github.com/ericbreno/FieldsCopier/mvn-repo/</url>
    <snapshots>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
    </snapshots>
</repository>

Core of FieldsCopier

<dependency>
    <groupId>org.fields.utils</groupId>
    <artifactId>FieldsCopier</artifactId>
    <version>1.1.0</version>
</dependency>

Attach sources

<dependency>
    <groupId>org.fields.utils</groupId>
    <artifactId>FieldsCopier</artifactId>
    <version>1.1.0</version>
    <classifier>sources</classifier>
</dependency>

Built With

  • Maven - Dependency Management

Authors

  • Eric Breno

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache License - see the LICENSE.md file for details

About

General use class which copies properties between objects from same or different types

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages