All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gitee.l0km.casban.CountLimitStrategy Maven / Gradle / Ivy

There is a newer version: 1.4.1
Show newest version
package com.gitee.l0km.casban;

import com.google.common.base.Supplier;
import com.google.common.collect.Range;

/**
 * 数量限制策略
 * @author guyadong
 *
 */
public enum CountLimitStrategy  implements Supplier {
	/** 要求大于等于0 */ANY(Range.atLeast(0)),
	/** 要求大于0 */NOT_EMPTY(Range.atLeast(1)),
	/** 要求大于0,小于等于1 */MOST_ONE(Range.closed(0,1)),
	/** 要求为1 */ONLY_ONE(Range.singleton(1));
	public final RangeFilter sizeFilter ;

	private CountLimitStrategy(Range filter) {
		this.sizeFilter = new RangeFilter(filter);
	}

	@Override
	public RangeFilter get() {
		return sizeFilter;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy