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. Play Real Money Slot Machines - Choices Casino
    Play slots at Choices 메리트카지노 Casino. Learn how to win real money with casino slots online. Play for free, win cash, and 10cric win real money. 카지노

    ReplyDelete

Post a Comment