Search in sources :

Example 1 with LongValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LongValidation in project ovirt-engine by oVirt.

the class EditQuotaClusterModel method validate.

public boolean validate() {
    IntegerValidation intValidation = new IntegerValidation();
    intValidation.setMinimum(1);
    LongValidation longValidation = new LongValidation();
    longValidation.setMinimum(1);
    getSpecificMemValue().setIsValid(true);
    getSpecificCpuValue().setIsValid(true);
    if (getSpecificMem().getEntity()) {
        getSpecificMemValue().validateEntity(new IValidation[] { longValidation, new NotEmptyValidation() });
    }
    if (getSpecificCpu().getEntity()) {
        getSpecificCpuValue().validateEntity(new IValidation[] { intValidation, new NotEmptyValidation() });
    }
    return getSpecificMemValue().getIsValid() && getSpecificCpuValue().getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LongValidation(org.ovirt.engine.ui.uicommonweb.validation.LongValidation) IntegerValidation(org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)

Example 2 with LongValidation

use of org.ovirt.engine.ui.uicommonweb.validation.LongValidation in project ovirt-engine by oVirt.

the class EditQuotaStorageModel method validate.

public boolean validate() {
    LongValidation longValidation = new LongValidation(1, 65535);
    getSpecificStorageValue().setIsValid(true);
    if (getSpecificStorage().getEntity()) {
        getSpecificStorageValue().validateEntity(new IValidation[] { longValidation, new NotEmptyValidation() });
    }
    return getSpecificStorageValue().getIsValid();
}
Also used : NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) LongValidation(org.ovirt.engine.ui.uicommonweb.validation.LongValidation)

Aggregations

LongValidation (org.ovirt.engine.ui.uicommonweb.validation.LongValidation)2 NotEmptyValidation (org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation)2 IntegerValidation (org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation)1