change git root

This commit is contained in:
2019-03-03 16:13:24 -07:00
parent a1d5a82570
commit 96c90a3c49
71 changed files with 180 additions and 18 deletions
+24
View File
@@ -0,0 +1,24 @@
plugins {
id 'java'
}
group 'edu.msudenver.tsp'
version '1.0'
sourceCompatibility = 1.8
sonarqube {
properties {
property "sonar.projectName", 'Parsing and Proofs Utilities'
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'lib', include: '**/*.jar')
testCompile group: 'junit', name: 'junit', version: '4.12'
}
@@ -0,0 +1,27 @@
package edu.msudenver.tsp.utilities;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import java.beans.FeatureDescriptor;
import java.util.stream.Stream;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public abstract class PersistenceUtilities {
private static String[] getNullPropertyNames(final Object source) {
final BeanWrapper wrappedSource = new BeanWrapperImpl(source);
return Stream.of(wrappedSource.getPropertyDescriptors())
.map(FeatureDescriptor::getName)
.filter(propertyName -> wrappedSource.getPropertyValue(propertyName) == null
|| propertyName.equals("id"))
.toArray(String[]::new);
}
public static void copyNonNullProperties(final Object source, final Object target) {
BeanUtils.copyProperties(source, target, getNullPropertyNames(source));
}
}