Eliraz Levi has posted comments on this change.

Change subject: common: adding maskValidator util
......................................................................


Patch Set 13:

(6 comments)

https://gerrit.ovirt.org/#/c/35144/13/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/IpAddressConverter.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/IpAddressConverter.java:

Line 1: package org.ovirt.engine.core.common.utils;
Line 2: 
Line 3: public class IpAddressConverter {
Line 4: 
Line 5:     private static IpAddressConverter ipAddConverter = new 
IpAddressConverter();
> s/ipAddConverter/INSTANCE
Done
Line 6: 
Line 7:     private IpAddressConverter() {
Line 8:     }
Line 9: 


https://gerrit.ovirt.org/#/c/35144/13/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/MaskValidator.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/validation/MaskValidator.java:

Line 4: import org.ovirt.engine.core.common.utils.ValidationUtils;
Line 5: 
Line 6: public class MaskValidator {
Line 7: 
Line 8:     private static MaskValidator validator = new MaskValidator();
> s/validator/INSTANCE
Done
Line 9: 
Line 10:     private MaskValidator() {
Line 11: 
Line 12:     }


Line 7: 
Line 8:     private static MaskValidator validator = new MaskValidator();
Line 9: 
Line 10:     private MaskValidator() {
Line 11: 
> please remove this line
Done
Line 12:     }
Line 13: 
Line 14:     public static MaskValidator getInstance() {
Line 15:         return validator;


Line 26:      *
Line 27:      * @return true if correct IPv4 format , false otherwise.
Line 28:      */
Line 29:     public boolean isValidNetmaskFormat(String mask) {
Line 30:         return mask != null && mask.matches("^" + 
ValidationUtils.IP_PATTERN_NON_EMPTY + "$");
> why not having ""^" + ValidationUtils.IP_PATTERN_NON_EMPTY + "$")" as an en
agreed to keep as is
Line 31:     }
Line 32: 
Line 33:     /***
Line 34:      * Check if mask is a string [0-32] (possible with / prefix)


Line 35:      *
Line 36:      * @return true if a string [0-32] (possible with /) which 
represent a valid prefix, false otherwise.
Line 37:      */
Line 38:     public boolean isPrefixValid(String mask) {
Line 39:         return mask != null && mask.matches("^/?" + 
ValidationUtils.SUBNET_PREFIX_PATTERN + "$");
> same here
agreed to keep as is
Line 40:     }
Line 41: 
Line 42:     /***
Line 43:      * check if mask is valid and netmasked formated and return true 
if does


https://gerrit.ovirt.org/#/c/35144/13/backend/manager/modules/common/src/test/java/org/ovirt/engine/core/common/utils/IpAddressConverterTest.java
File 
backend/manager/modules/common/src/test/java/org/ovirt/engine/core/common/utils/IpAddressConverterTest.java:

Line 11: 
Line 12: @RunWith(Parameterized.class)
Line 13: public class IpAddressConverterTest {
Line 14: 
Line 15:     final private String ipAdd;
> s/ipAdd/ipAddress
Done
Line 16:     final private long ipAsLong;
Line 17: 
Line 18:     public IpAddressConverterTest(String ipAdd, long ipAsLong) {
Line 19:         this.ipAdd = ipAdd;


-- 
To view, visit https://gerrit.ovirt.org/35144
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I04fb0aa2193801688f1bfc5dc7684cabdfa2827d
Gerrit-PatchSet: 13
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eliraz Levi <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Eliraz Levi <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Martin Mucha <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Yevgeny Zaspitsky <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to