This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id "org.springframework.boot" version "2.1.3.RELEASE" apply false | |
id "io.spring.dependency-management" version "1.0.6.RELEASE" apply false | |
} | |
def querydslProjects = [project(':domains')] | |
configure(subprojects) { | |
apply plugin: "java" | |
apply plugin: "org.springframework.boot" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JarResourceWalkerTest { | |
@Test | |
public void test1234() throws Exception { | |
walk("/org/springframework"); | |
} | |
private static ConcurrentMap<String, Object> locks = new ConcurrentHashMap<>(); | |
public void walk(String path) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.crypto.Cipher; | |
import javax.crypto.KeyGenerator; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.security.Key; | |
import java.security.SecureRandom; | |
/** | |
* Created by sjpark on 2017-05-03. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
import java.beans.IntrospectionException; | |
import java.beans.Introspector; | |
import java.beans.PropertyDescriptor; | |
import java.lang.reflect.InvocationTargetException; | |
public class DtoDiffTest { | |
@Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface EnumMatchable<T extends Enum<T>> { | |
default boolean contains(Enum<T>... elements){ | |
if(elements.length == 0){ | |
throw new IllegalArgumentException("하나 이상의 elements가 입력되어야 합니다."); | |
} | |
for (Enum<T> element : elements) { | |
if(element == this){ | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://minborgsjavapot.blogspot.kr/2014/12/java-8-initializing-maps-in-smartest-way.html | |
public class MapInitializerTest { | |
public static <K, V> Map.Entry<K, V> entry(K key, V value) { | |
return new AbstractMap.SimpleEntry<>(key, value); | |
} | |
public static <K, U> Collector<Map.Entry<K, U>, ?, Map<K, U>> entriesToMap() { | |
return Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.encar.api.pay.common.util; | |
import com.encar.api.pay.common.except.PaymentException; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Problem1 { | |
@Test | |
public void simpleTest(){ | |
System.out.println(action(100)); | |
System.out.println(action(194)); | |
System.out.println(action(3142)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String getDiscriminatorValue(){ | |
DiscriminatorValue val = this.getClass().getAnnotation( DiscriminatorValue.class ); | |
return val == null ? null : val.value(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.Character.UnicodeScript; | |
import java.util.ArrayList; | |
import java.util.List; | |
import static java.lang.Character.UnicodeScript.HANGUL; | |
/** | |
* Create asciiTable for java | |
* | |
* <pre> |
NewerOlder