public class BHiveUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
initialVector |
| Constructor and Description |
|---|
BHiveUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildErrorMessage(org.springframework.validation.Errors errors,
org.springframework.context.MessageSource messageSource,
String seperator)
에러 메시지 획득
|
static byte[] |
decode(byte[] data) |
static String |
encode(byte[] data) |
static <T extends Exception> |
findInnerException(Throwable ex,
Class<? extends Throwable> requiredType)
예외 또는 예외 내부 Cause를 뒤져서 원하는 Type의 예외를 찾는다.
|
static <T> T |
fromJson(String json,
Class<T> valueType)
주어진 Json문자열을 객체 변환
|
static List<String> |
getActiveProfiles()
Spring Active Profiles 획득
|
static String |
getActiveServerProfile()
Spring Active Profiles 획득 - 서버환경: local, dev, stage, real 중의 한개 값
|
static String |
getCurrentMethodName()
현재메소드명 획득
|
static String |
getMessageOfException(Throwable ex,
boolean includeExceptionClassSimpleName,
boolean includeCauseMessage)
예외 메시지를 획득 (옵션에 따라 Throwable의 Cause의 메시지도 포함)
|
static String |
getStackTraceMethodName(int upperDepth)
현재메소드명 또는 호출자의 메소드명을 획득
|
static Boolean |
hasInnerException(Throwable ex,
Class<? extends Throwable> requiredType)
예외 또는 예외 내부 Cause를 뒤져서 원하는 Type이 있는지를 확인한다.
|
static boolean |
isAwsProfile()
Spring Active Profile이 aws인지 확인
|
static boolean |
isDevProfile()
Spring Active Profile이 dev인지 확인
|
static boolean |
isLocalProfile()
Spring Active Profile이 local인지 확인
|
static boolean |
isRealProfile()
Spring Active Profile이 real인지 확인
|
static boolean |
isTestProfile()
Spring Active Profile이 test인지 확인
|
static String |
toJson(Object object)
주어진 객체를 JSON문자열로 Serialize (Jackson2 ObjectMapper 사용)
|
static String |
toJson(Object object,
Class<?> serializationView)
주어진 객체를 JSON문자열로 Serialize (Jackson2 ObjectMapper 사용)
|
protected static final String initialVector
public static List<String> getActiveProfiles()
public static String getActiveServerProfile()
public static boolean isLocalProfile()
public static boolean isDevProfile()
public static boolean isRealProfile()
public static boolean isAwsProfile()
public static boolean isTestProfile()
public static String getCurrentMethodName()
public static String getStackTraceMethodName(int upperDepth)
upperDepth - 0이면 현재메소드명, 1이상이면 상위 호출 depth 메소드명public static String toJson(Object object)
object - 변환할 객체public static String toJson(Object object, Class<?> serializationView)
object - 변환할 객체serializationView - Serialization에 사용할 View Class (@JsonView 참고)public static <T> T fromJson(String json, Class<T> valueType)
json - JSON문자열valueType - 획득할 객체타입public static String getMessageOfException(Throwable ex, boolean includeExceptionClassSimpleName, boolean includeCauseMessage)
ex - 메시지를 가져올 Throwable 예외includeExceptionClassSimpleName - 예외 클래스의 SimpleName을 포함?includeCauseMessage - Cuase의 메시지도 포함할 것인가?public static <T extends Exception> T findInnerException(Throwable ex, Class<? extends Throwable> requiredType)
ex - 예외requiredType - 예외 또는 예외내부Cause에서 찾아볼 예외 타입public static Boolean hasInnerException(Throwable ex, Class<? extends Throwable> requiredType)
ex - 예외requiredType - 예외 또는 예외내부Cause에서 찾아볼 예외 타입public static String buildErrorMessage(org.springframework.validation.Errors errors, org.springframework.context.MessageSource messageSource, String seperator)
errors - 에러정보 객체 (BindingResult등...)messageSource - 메시지소스. 에러메시지 변환에 사용seperator - 에러메시지간 구분자public static String encode(byte[] data)
public static byte[] decode(byte[] data)
Copyright © 2018. All rights reserved.