Skip to content

Copy Java Object fields from multiple sources into a target with option for greater value. Ignores null fields. Most useful for model update with PATCH method + other Object Utils.

License

Notifications You must be signed in to change notification settings

thehackersdeck/objutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

objcopier

Copy Java Object fields from multiple sources into a target with option for greater value. Ignores null fields. Most useful for model update with PATCH method.


Table of content

Why

Installation

Download the jar file from the releases and add the downloaded konfiger-$.jar to your java or android project class path or library folder.

Maven

Add the following repository and dependency detail to your pom.xml

Using mvn-repo:

<dependencies>
    <dependency>
        <groupId>io.github.thecarisma</groupId>
        <artifactId>objcopier</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>objcopier</id>
        <url>https://raw.github.com/thehackersdeck/objcopier/mvn-repo/</url>
    </repository>
</repositories>

Using jitpack.io:

<dependencies>
    <dependency>
        <groupId>com.github.thehackersdeck</groupId>
        <artifactId>objcopier</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Gradle

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency:

dependencies {
        implementation 'com.github.thehackersdeck:objcopier:1.0.0'
}

Usage

Copy two from a source into target

ObjCopier.copyFields(target, source);

Copy two from multiple sources into a single target.

ObjCopier.copyFields(target, source1, source2, source);

About

Copy Java Object fields from multiple sources into a target with option for greater value. Ignores null fields. Most useful for model update with PATCH method + other Object Utils.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages