/** * return a Wildcard object that has the given nwDstCidrMask set. * <b>NOTE:</b> NOT a mutator function. 'this' wildcard object stays * unmodified. </b> * * @param dstCidrMask * dest mask to set in <b>normal CIDR notation</b>, i.e., 8 means * x.x.x.x/8 * @return a modified object */ public Wildcards withNwDstMask(final int dstCidrMask) { final int flags = Flag.NW_DST.setInt(this.flags, Math.max(0, 32 - dstCidrMask)); if (flags == this.flags) { return this; } else { return new Wildcards(flags); } }
/** * return a Wildcard object that has the given nwSrcCidrMask set. * <b>NOTE:</b> NOT a mutator function. 'this' wildcard object stays * unmodified. </b> * * @param srcCidrMask * source mask to set in <b>normal CIDR notation</b>, i.e., 8 * means x.x.x.x/8 * @return a modified object */ public Wildcards withNwSrcMask(final int srcCidrMask) { final int flags = Flag.NW_SRC.setInt(this.flags, Math.max(0, 32 - srcCidrMask)); if (flags == this.flags) { return this; } else { return new Wildcards(flags); } }