Java Domain Value Framework



I've just released the 'Domain Value' framework for easily creation of Java domain value classes.

github: https://github.com/qoomon/java-domain-value

Domain-Values

Maven Dependency
<dependency>
    <groupId>com.qoomon</groupId>
    <artifactId>domainvalue</artifactId>
    <version>2.0.0</version>
</dependency>
Example: BankAccountNumber
public class BankAccountNumber extends LongDV {

    protected BankAccountNumber(Long value) {
        super(value);
    }

    public static BankAccountNumber of(Long value) {
        assert isValid(value) : isNotValidText(value, Id.class);
        return new Id(value);
    }

    public static boolean isValid(Long value) {
        return LongDV.isValid(value)
                && value > 0;
    }

    public static BankAccountNumber of(String stringValue) {
        Long value = Long_of(stringValue);
        return of(value);
    }

    public static boolean isValid(String stringValue) {
        if(Long_isValid(stringValue)){
            Long value = Long_of(stringValue);
            return isValid(value);
        }
        return false;
    }

}

Comments

  1. Grosvenor Hotel Casino & Spa: Luxury Hotel in Israel - Air
    Grosvenor Hotel Casino where to order air jordan 18 retro toro mens sneakers & Spa is how to buy air jordan 18 retro men blue situated on the top level of Israel's renowned air jordan 18 retro red suede online store Gold Coast and features over 2,000 where to buy air jordan 18 retro guest rooms. Located in 사설토토 추천 샤오미 the centre of

    ReplyDelete
  2. Vint Ceramic Art | TITNIA & TECHNOLOGY
    Explore 바카라 사이트 an https://jancasino.com/review/merit-casino/ all new “Vint Ceramic Art” project on TITNIA gri-go.com & TECHNOLOGY. Our team titanium flat iron of sculptors and artists have created https://septcasino.com/review/merit-casino/ new and

    ReplyDelete

Post a Comment