# 유효성 검사를 타입 시스템으로 옮기는 Java 라이브러리 (123종 사전 정의 타입)

> Clean Markdown view of GeekNews topic #29657. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=29657](https://news.hada.io/topic?id=29657)
- GeekNews Markdown: [https://news.hada.io/topic/29657.md](https://news.hada.io/topic/29657.md)
- Type: news
- Author: [k42kr](https://news.hada.io/@k42kr)
- Published: 2026-05-19T18:21:47+09:00
- Updated: 2026-05-19T18:21:47+09:00
- Original source: [github.com/JunggiKim](https://github.com/JunggiKim/java-refined)
- Points: 1
- Comments: 0

## Topic Body

**Java Refined**는 `String`, `int` 자리에 `NonBlankString`, `PositiveInt`처럼 사전 정의된 정제(refinement) 타입을 박아 **검증을 시그니처로 옮기는** 라이브러리입니다.  
  
```java  
// Before  
void createUser(String name, int age, List&lt;String&gt; roles) {  
    if (name == null || name.isBlank()) throw new IAE("name");  
    if (age <= 0) throw new IAE("age");  
    if (roles == null || roles.isEmpty()) throw new IAE("roles");  
}  
  
// After  
void createUser(NonBlankString name, PositiveInt age, NonEmptyList&lt;String&gt; roles) { }  
```  
  
- 즉시 import해서 쓰는 **123종** 사전 정의 타입 (VAVR/Arrow는 패턴만 줌)  
- `NonEmptyList&lt;T&gt;`가 `List&lt;T&gt;`를 **직접 구현** — 언래핑 불필요  
- Zero runtime deps · Java 8+ · MIT · Maven Central · Kotlin 확장 모듈 별도  
- 100% 라인 커버리지 + **95% PIT 뮤테이션 점수**  
- 솔직히: 1인 프로젝트, JMH 벤치마크 미존재, Jackson/`@Valid` 브리지 없음  
  
GitHub: https://github.com/JunggiKim/java-refined

## Comments



_No public comments on this page._
